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 @ 2023-04-02 22:31  熊先生不开玩笑  阅读(665)  评论(0)    收藏  举报