nginx 下监听同一端口通过路径转发不同服务

注意 v1d2 最优先匹配

       server {
        listen   80;
        server_name  localhost;	 
        location /v1d2 {
            proxy_pass http://127.0.0.1:8088;
        }

	location / {
		root   /data/dist;
		try_files $uri $uri/ @router;
		index  index.html index.htm;
	}

	        location @router {
                rewrite ^.*$ /index.html last;
        }

}

posted @   熊先生不开玩笑  阅读(653)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET10 - 预览版1新功能体验(一)
点击右上角即可分享
微信分享提示