OpenResty重定义40x, 50x页面
有的时候需要重新定义400,401,404,405,501,502等页面,可以使用以下方法
在nginx.conf中,server下,添加代码:
server { listen 8000; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; fastcgi_intercept_errors on; #这行代码是启用重定义,否则还是默认 error_page 400 /error.html; location /error.html { content_by_lua_file '$document_root/error.lua'; }