Created
December 28, 2017 09:48
-
-
Save keyganker/f3b531f4ace1c8d71fe0b4d4c13b4b84 to your computer and use it in GitHub Desktop.
nginx配置http默认错误页面
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 主要是用到了nginx的error_page指令 | |
server{ | |
server_name 10.21.200.75; | |
listen 6666; | |
error_page 404 @404; | |
location @404 { | |
root /home/fey6779; | |
try_files /404.html =404; | |
} | |
error_page 500 @500; | |
location @500 { | |
root /home/fey6779; | |
try_files /500.html =500; | |
} | |
location ~ \.php { | |
root /home/fey6779; | |
fastcgi_split_path_info ^(.+\.php)(.*)$; | |
set $fsn /test.php; | |
if (-f $document_root$fastcgi_script_name) { | |
set $fsn $fastcgi_script_name; | |
} | |
fastcgi_pass 127.0.0.1:9000; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fsn; | |
fastcgi_intercept_errors on; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment