server {
listen 80;
server_name www.myserver_name.com;
index index.html index.htm index.php;
root /usr/local/openresty/nginx/html/manager/lebi; #笔者的YII的业务代码和framework都放在html目录下的manager目录
autoindex on;
access_log /usr/local/openresty/nginx/logs/queue.access.log;
error_log /usr/local/openresty/nginx/logs/queue.error.log;
rewrite "^/sitemap.xml" /uploads/sitemap/sitemap.xml last;
error_page 500 502 503 504 /50x.html;
location / {
if (!-e $request_filename){
rewrite ^/(.*) /index.php last;
}
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}