一、nginx+tomcat
后端为tomcat,nginx代理报504超时错误。
问题描述:
#错误
1 | 1.198.17.123 - - [06/Jul/2018:01:48:57 +0000] "POST /mapbj3/getticket HTTP/1.1" 504 537 "https://XXXXXXXXXX.com/walkcode3/index.html?openId=oB6UW0cF3Z_dnYXnz4tG4OFt7Rt0" "Mozilla/5.0 (Linux; Android 8.1; PACM00 Build/O11019; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/53.0.2785.143 Crosswalk/24.53.595.0 XWEB/155 MMWEBSDK/19 Mobile Safari/537.36 MicroMessenger/6.6.6.1300(0x26060638) NetType/WIFI Language/zh_CN MicroMessenger/6.6.6.1300(0x26060638) NetType/WIFI Language/zh_CN miniProgram" "-" |
1、项目本地访问没问题,通过nginx访问报504错误;
2、重启nginx后正常,反复发生,其它项目代理没有问题;
3、搜索了一大推”NGINX 504 Gateway Time-out tomcat”,都是与php有关的,而默认优化的就是php配置的;
问题处理:
修改/etc/nginx/nginx.conf,添加如下信息
1 | # cat /etc/nginx/nginx.conf |
二、nginx+php(未验证)
问题如上,问题处理添加如下内容
1 | user nginx; |
参考文档
https://blog.csdn.net/lcj_star/article/details/76672748https://www.iyunv.com/thread-319236-1-1.html