nignx+php 虛擬目錄配置支持PHP,本人實際測試通過,沒有問題。
server {
listen 80;
server_name xxx.com www.xxx.com;
index index.html index.htm index.php;
root /alidata/www/xxx/;
location ~ /xxx/.+.php$ {
root /alidata/www/;
rewrite /xxx/(.*.php) /
欄目內容
break;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME /alidata/www/xxx/$fastcgi_script_name;
}
location ~ ^/xxx(.*)$ {
alias /alidata/www/xxx/
欄目內容
;
index index.php index.html index.htm;
}
location ~ .*.(php|php5)?$
{
#fastcgi_pass unix:/tmp/php-cgi.sock;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location ~ .*.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*.(js|css)?$
{
expires 1h;
}
#偽靜態規則
#include /alidata/server/nginx/conf/rewrite/phpwind.conf;
#access_log /alidata/log/nginx/access/phpwind.log;
}
|