linux nginx 301跳转端口丢了

葫芦的运维日志

浏览量 3562 2015/12/09 15:16

在外层有端口映射设备,映射到后端nginx代理 再行跳转端口丢失时,在$http_host后增加端口

在proxy_set_header $http_host:13388 后增加PORT 13388


 listen 80 default_server;
    location / {
        proxy_pass http://127.0.0.1;
        proxy_set_header Host             $http_host;(或者使用:$host:13388)
        proxy_set_header X-Real-IP        $remote_addr;  
        proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
    }

葫芦的运维日志

打赏

留言板

留言提交后需管理员审核通过才会显示

© 冰糖葫芦甜(bthlt.com) 2025 王梓打赏联系方式陕ICP备17005322号-1