server {
listen 7001;
server_name localhost;
location / {
root D:/demo/dist;
try_files $uri $uri/ @router;
index index.html index.htm;
}
location @router {
rewrite ^.*$ /index.html last;
}
location /api {
proxy_pass https://a.com/api;
}
}
server {
listen 7002;
server_name localhost;
location / {
root D:/demo/dist;
try_files $uri $uri/ /index.html;;
index index.html index.htm;
}
location /api {
proxy_pass https://a.com/api;
}
}