#本机
server {
listen 80;
server_name www.stat.me ;
root "E:/lein/rkts/rkts/code/stat/public";
autoindex off;
location / {
index index.html index.htm index.php;
#try_files $uri $uri/ /server.php?/$uri;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}
#供局域网内其他机器访问
server {
listen 8090;
server_name 192.168.115.197:8090 ;
root "E:/lein/rkts/rkts/code/stat/public";
autoindex off;
location / {
index index.html index.htm index.php;
#try_files $uri $uri/ /server.php?/$uri;
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php(.*)$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
}
}
配置nginx局域网内可访问
最新推荐文章于 2024-08-22 09:33:31 发布