nginx埠轉發tomcat,80轉8080和8433

牛刀殺雞發表於2015-01-12


server {

        listen       80;
        server_name  localhost;
        root   /usr/local/webserver/nginx/html;
        index  index.html index.htm index.php;
 
      #80轉8080:
       location / {
            proxy_pass http://192.168.1.111:18080/RSZC;
            proxy_set_header Host $host:18080;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
 
      #80轉8443:
       location /login {
            proxy_pass https://192.168.1.111:8443/sso;
            proxy_set_header Host $host:8443;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
 
    }

相關文章