nginx+php目录配置,nginx虚拟目录配置(php-fpm+fastcgi)
server {
listen 80;
server_name www.test.net;
index index.html index.htm index.php;
root /www/www.test.net/public;
access_log /www/access_log/test_log;
location / {
if (!-e $request_filename){ rewrite (.*) /index.php last;}
}
location /uploads {
if (!-e $request_filename){ rewrite (.*) /uploads/index.php last;}
}
location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|html)$ {
access_log off;
expires 30d;
}
location ~ .php$ {
root /www/www.test.net/public;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
}
上一篇: php坏境配置homestead和swoole的安装
下一篇: Nginx和FastCGI学习之一