nginx端口转发配置

 server {
        listen       8082;
        server_name  localhost;


		location / {
       proxy_pass       http://192.168.0.20:8082;
       proxy_set_header Host      $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       client_max_body_size  50M;
         }

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

	 server {
        listen       7878;
        server_name  localhost2;

		location / {
       proxy_pass       http://192.168.0.20:7878;
       proxy_set_header Host      $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       client_max_body_size  50M;
         }

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

  
    }

  

posted on 2021-01-28 09:41  木色小罗  阅读(319)  评论(0编辑  收藏  举报

导航

诗与远方