惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

J
Java Code Geeks
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
博客园 - 【当耐特】
云风的 BLOG
云风的 BLOG
Martin Fowler
Martin Fowler
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
量子位
Engineering at Meta
Engineering at Meta
博客园 - 叶小钗
T
The Blog of Author Tim Ferriss
Recent Announcements
Recent Announcements
罗磊的独立博客
B
Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
U
Unit 42
Microsoft Azure Blog
Microsoft Azure Blog
D
Docker
N
Netflix TechBlog - Medium
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
B
Blog RSS Feed
I
InfoQ
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
V2EX

博客园 - 风与叶子

flutter event_bus 底层技术 Linux libreoffice安装 word转pdf 中文乱码(缺少字体解决) 设计短链接(short URL)系统 羊了个羊小程序通关脚本 mysql 删除异常进程脚本 docker 设置国内镜像源 python2.7 升级到 python3.6 aliyun OOS 资源同步【ossutil】 shell之文件路径截取 获取淘宝订单的解决方案——转 mysql实例的连接数max_user_connections 和max_connections 配置的那些事 Git log怎么查看分支提交过哪些文件 一篇文章搞定Git——Git代码管理及使用规范 小程序获取手机号 thinkphp3.2.3 CentOS7 YUM 安装MongoDB 4.0 shell 下载aliplayer 的视频 使用iptables给特定IP或端口限流 多台centos服务器同步更新代码文件 Nginx1.14.0+ModSecurity实现简单的WAF
Nginx反向代理location与proxy_pass配置规则总结
风与叶子 · 2022-09-16 · via 博客园 - 风与叶子
server {
        listen       8081;
        server_name  localhost;

        location / {
            root   html;
            index  index.html index.htm;
        }
#情景1:proxy_pass后有/ ,表绝对路径,不把匹配部分加入最终代理路径(location 和proxy_pass结尾一致)
        #访问地址:http://localhost:8081/WCP.Service/wcp/modeladapter/download/asc.shtml
        #最终代理:http://10.194.171.7:13082/modeladapter/download/asc.shtml
		location /WCP.Service/wcp/modeladapter/download/ {
            proxy_pass   http://10.194.171.7:13082/modeladapter/download/;
        }
        #访问地址:http://localhost:8081/model/asc.shtml
        #最终代理:http://127.0.0.1:8082/model/asc.shtml
		location /model/ {
            proxy_pass   http://127.0.0.1:8082/model/;
        }
#情景2:proxy_pass后有/ ,表绝对路径,不把匹配部分加入最终代理路径(location 和proxy_pass结尾不一致)
        #访问地址:http://localhost:8081/model/asc.shtml
        #最终代理:http://127.0.0.1:8082/asc.shtml
		location /model/ {
            proxy_pass   http://127.0.0.1:8082/;
        }
#情景3:proxy_pass后没有 / ,Nginx会把匹配部分带到代理的url
        #访问地址:http://localhost:8081/model/asc.shtml
        #最终代理:http://127.0.0.1:8082/model/asc.shtml
		location /model/ {
            proxy_pass   http://127.0.0.1:8082;
        }

#情景4
        #访问地址:http://localhost:8081/model/asc.shtml
        #最终代理:http://127.0.0.1:8082/AAAmodel/asc.shtml
		location /model/ {
            proxy_pass   http://127.0.0.1:8082/AAA;
        }
#情景5
        #访问地址:http://localhost:8081/model/asc.shtml
        #最终代理:http://127.0.0.1:8082/asc.shtml
		location /model {
            proxy_pass   http://127.0.0.1:8082/;
        }
#情景6
        #访问地址:http://localhost:8081/modelBBB/asc.shtml
        #最终代理:http://127.0.0.1:8082/asc.shtml
		location /model {
            proxy_pass   http://127.0.0.1:8082/;
        }


		location /opus-front-sso {
            proxy_pass   http://10.194.170.94/opus-front-sso;
        }
		location /awater {
            proxy_pass   http://10.194.170.94/awater;
        }

        
    }

  https://blog.csdn.net/m0_67391121/article/details/126113725

posted @ 2022-09-16 15:52  风与叶子  阅读(329)  评论()    收藏  举报