nigixproxy

xiaoxiao2021-02-28  147

nigix做反向代理  

注意  :$proxy_port  与 :$server_port 区别

$server_port :nigix监听的端口

$proxy_port : 服务器真正访问的端口

server {

        listen       8888;         server_name  192.168.1.114;                 #charset koi8-r;         #access_log  logs/host.access.log  main;         location  /a {             proxy_pass http://127.0.0.1:8080;              proxy_set_header Host $host:$proxy_port;         }         location  /b {             proxy_pass http://192.168.1.102:8080/b;             proxy_cookie_path /a /b;         }         #error_page  404              /404.html;         # redirect server error pages to the static page /50x.html         #         error_page   500 502 503 504  /50x.html;         location = /50x.html {             root   html;

        }

-----------------------------------------------------------------------------------------------------------------

server {         listen       8888;         server_name  192.168.1.114;                 #charset koi8-r;         #access_log  logs/host.access.log  main;         location  /a {             proxy_pass http://127.0.0.1:8080;             proxy_set_header Host $host:$server_port;         }         location  /b {             proxy_pass http://192.168.1.102:8080/b;             proxy_cookie_path /a /b;         }         #error_page  404              /404.html;         # redirect server error pages to the static page /50x.html         #         error_page   500 502 503 504  /50x.html;         location = /50x.html {             root   html;         }

转载请注明原文地址: https://www.6miu.com/read-26145.html

最新回复(0)