美文网首页
若依反相代理

若依反相代理

作者: 代来 | 来源:发表于2020-06-27 09:13 被阅读0次

    普通代理方式

    location/{

    root /root/workspace/ruoyi-ui/dist;

    index  index.html index.htm;

    }

    location /prod-api/{

            proxy_set_header Host $http_host;

            proxy_set_header X-Real-IP $remote_addr;

            proxy_set_header REMOTE-HOST $remote_addr;

            proxy_set_header Host X-Forward-For $proxy_add_x_forwarded_for;

            proxy_pass http://192.168.31.101:8080/;

    }

    集群代理方式:

    {

        listen 80;

    sever_name localhost;

    upstream ruoyi{

            server 192.168.31.101.8080 weight=5;

            server 192.168.31.102.8080  weight=3;

    }

    location /{

            root  /root/workspace/ruoyi-ui/dist;

            index index.html  index.html;

    }

    location /prod-api/{

    proxy_set_header Host $http_host;

    proxy_set_header X-Real-IP $remote_addr;

    proxy_set_header REMOTE-HOST $remote_addr;

    proxy_set_header Host X-Forward-For $proxy_add_x_forwarded_for;

    proxy_pass http://ruoyi/;

    }

    }

    相关文章

      网友评论

          本文标题:若依反相代理

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