server { listen 80; server_name www.demo.com mayifanx.com; root /data/www/demo; index index.php index.html index.htm; #红色部分支持rewrite location / { if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 last; } } location ~ \.php { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; #蓝色部分是支持pathinfo fastcgi_split_path_info ^(.+\.php)(.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; } }
原文地址:https://www.cnblogs.com/yuzhould/p/9161633.html
时间: 2024-10-24 08:45:08