您的位置:首页 > 运维架构 > Nginx

nginx虚拟目录配置(php-fpm+fastcgi)

2015-08-10 17:30 851 查看
</pre><p class="p1"><pre name="code" class="plain">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;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: