更改了默认的配置,把 index 和 root 放出来,这样 执行 php 就不用再重复指定 root
server { listen 80; server_name localhost alias 127.0.0.1; root I:/upupw/htdocs; index index.html index.htm index.php u.php; location / { include I:/upupw/htdocs/up-*.conf; } error_page 404 /404.html; location ~ ^.+\.php { fastcgi_pass bakend; 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.conf; } } server { listen 8083; server_name localhost alias 127.0.0.1; root I:/upupw/htdocs/quotation; index index.html index.htm index.php; location / { include I:/upupw/htdocs/quotation/rewirte.conf; #重写规则,放在了相应根目录 } error_page 404 /404.html; location ~ ^.+\.php { fastcgi_pass bakend; 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.conf; } } |
|