nginx配置指向同一个目录 这样可以解决 windows 请求不到自己接口的问题
server {
listen 80;
server_name server_name ;
root "*******";
location / {
autoindex on;
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$query_string;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ .*\.(gif|jpg|png|htm|html|css|js|flv|ico|swf)(.*) {
add_header Cache-Control no-store;
}
}
server {
listen 80;
server_name server_name ;
root "******";
location / {
autoindex on;
index index.html index.htm;
try_files $uri $uri/ /index.php?$query_string;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
location ^~ /python/ {
alias "*****"; //虚拟目录
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9001;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ .*\.(gif|jpg|png|htm|html|css|js|flv|ico|swf)(.*) {
add_header Cache-Control no-store;
}
}