server {
listen 80;
server_name blog.jlhou.cn;
root /web/blog.jlhou.cn/web;
location / {
index index.html index.php index.htm;
# 隱藏index.php文件
if (!-e $request_filename){
rewrite ^/(.*)$ /index.php/$1 last;
}
}
location ~ \.php {
fastcgi_pass 127.0.0.1:9000;
# 入口文件
fastcgi_index index.php;
# 開啓支持pathinfo路由模式
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
error_page 404 403 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
記錄一下