当前位置: 代码迷 >> 应用服务器 >> nginx反向代理tomcat出有关问题,求教!
  详细解决方案

nginx反向代理tomcat出有关问题,求教!

热度:10018   发布时间:2013-02-26 00:00:00.0
nginx反向代理tomcat出问题,求教!!
nginx配置

server {
     listen       80;
      server_name  admin.hai-qiang.com;
     #access_log  logs/host.access.log  main;    
     location / {
         proxy_pass              http://admin.hai-qiang.com:8080/;
         proxy_redirect          off;
         proxy_set_header        Host            $host;
         proxy_set_header        X-Real-IP       $remote_addr;
         proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
      }
 }


tomcat绑定本机<Connector port="8080" address="127.0.0.1" protocol="HTTP/1.1"/> 出现502 Bad Gateway
去除address="127.0.0.1"就正常。
我主要想禁止tomcat直接对外暴露。
请问有谁知道是哪里有问题,该怎么配置吗?


------解决方案--------------------------------------------------------
知道了,proxy_pass不能填域名,直接填本机ip
  相关解决方案