此配置是在lnmp 一键安装包运行:
server
{listen 80;
#listen [::]:80 default_server ipv6only=on;
server_name test.com;
root /opt/weixing;
#error_page 404 /404.html;
location /
{
index index.html index.htm index.php;
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires -1;
break;
}
location ~ .*\.(js|css)?$
{
expires -1;
break;
}
if (-f $request_filename) {
expires max;
break;
}
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?$1 last;
break;
}
}
location /bugfree
{
index index.html index.htm index.php;
alias /opt/zentaopms/www/;
include enable-php2.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires -1;
break;
}
location ~ .*\.(js|css)?$
{
expires -1;
break;
}
}
location /nginx_status
{
stub_status on;
access_log off;
}
location ~ /\.
{
deny all;
}