server { listen 80; index index.php index.html; server_name test.102sr.cn; root /var/www/public; location / { # 检查URL是否包含 install.php if ($request_uri ~* /install.php) { rewrite ^/install.php(.*)$ /install.php?s=$1 last; } if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 last; break; } } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass phpfpm:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } }