nginx问题504解决

如果nginx反向代理tomcat一定要写tomcat的服务器ip地址,反向其他web也是一样的,必须这样写,要不然会504
504有两种原因,第一是超时时间
http模块添加以下配置参数

proxy_connect_timeout    600;
proxy_read_timeout       600;
proxy_send_timeout       600;

第二是代理错误
例子

server {         

         listen       80;  

        server_name  域名; 


        location / {  

            proxy_pass ip地址:8091/;   
            

            root   html;  

            index  index.html index.htm;  

         }   

         

  }
发布了147 篇原创文章 · 获赞 9 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/weixin_44049466/article/details/104916852