Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我知道我可以为自定义错误页面设置文件:
location / { error_page 404 = /mybad.html; }
但我只想在配置文件中将我的页面覆盖作为内联文本提供:
location / { error_page 404 = "<H1>Sorry!</H1>" }
nginx可以做到这一点吗?
location / { error_page 404 @sorry; } location @sorry { return 404 "<H1>Sorry!</H1>"; }