nginx反向代理tomcat程序,资源代码404

nginx简单的反向代理一般是

 server{
                listen      80;
                server_name   localhost;
                index index.html ;
     location / {
             proxy_pass      http://192.168.1.x/;
         }

    }

这是最简单的nginx反向代理,用前辈的话来说最low的方式。我就用这种方式代理,页面服务不正常出现很多404,
其实很简单,修改如下:

location / {
        proxy_pass http://192.168.1.x/
        proxy_set_header Host $host:${server_port};
        }

猜你喜欢

转载自blog.csdn.net/arno_e/article/details/80647008