转自: http://blog.csdn.net/kkgbn/article/details/52153383
tomcat关闭后 请求返回502状态码
error_page 404 /404.html; location = /40x.html { } error_page 500 503 504 /50x.html; location = /50x.html { } error_page 502 /502.html; location = /502.html { root html; }
在nginx的html目录新建个502.html
<!DOCTYPE html> <html> <head> <title>502</title> <style> body { width: 35em; margin: 0 auto; font-family: Tahoma, Verdana, Arial, sans-serif; } </style> </head> <body> <h1>502</h1> <p>services unavailable(502)</p> <a href="http://nginx.org/r/error_log">error log</a> </body> </html>
所有的tomcat都关闭,测试结果如图所示
检测nginx配置后重启