参数

Ubuntu Nginx 参数常用指令

error_page

Nginx 自订错误页

server {
    error_page 404 https://kejyun.com/404; # 错误页
}

proxy_intercept_errors

若被代理伺服器回传 400 或大于 400 的状态码,启用设定的 error_page 设定,预设为 off 不启用

Determines whether proxied responses with codes greater than or equal to 300 should be passed to a client or be intercepted and redirected to nginx for processing with the error_page directive.

server {
    proxy_intercept_errors on;
}

fastcgi_intercept_errors

若被 FastCGI 伺服器回传 300 或大于 300 的状态码,启用设定的 error_page 设定,预设为 off 不启用

Determines whether FastCGI server responses with codes greater than or equal to 300 should be passed to a client or be intercepted and redirected to nginx for processing with the error_page directive.

server {
    proxy_intercept_errors on;
}

参考资料