server {
listen 80;
server_name www.test123.com;
location / {
# try_files $uri $uri/ /index.php?s=$uri&$args;
root /data/www/test123;
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^/index.php(.*)$ /index.php?s=$1 last;
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
location ~ \.php$ {
root /data/www/test123;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
转载于:https://my.oschina.net/u/3223370/blog/1548827