美文网首页WEB前端笔记本
Nginx反向代理访问内网另一台服务器配置

Nginx反向代理访问内网另一台服务器配置

作者: 随行者pgl | 来源:发表于2019-11-15 10:19 被阅读0次

    做为反向代理Nginx服务器配置如下

    server {

            listen       80;

            server_name  xiaohost.com  www.xiaohost.com;

            if ($uri ~ [A-Z]){ rewrite ^(.*)$ $url last; }

            charset utf-8;

             proxy_set_header        Host            $http_host;

             proxy_set_header        X-Real-IP       $remote_addr;

             proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;

             location / {

                    proxy_pass    http://192.168.1.2:80;

          }

    }

    最终被访问的服务器的内网IP为192.168.1.2端口80

    相关文章

      网友评论

        本文标题:Nginx反向代理访问内网另一台服务器配置

        本文链接:https://www.haomeiwen.com/subject/ekujictx.html