我现在是这么做的:
ngnix
server {
listen 3000;
location /console {
alias /usr/share/nginx/html/console;
try_files $uri $uri/ /console/index.html;
}
location /myApi/ {
proxy_pass http://xbh-halo2:8090/;
}
}
server {
listen 4000;
location /uc {
alias /usr/share/nginx/html/uc;
try_files $uri $uri/ /uc/index.html;
}
location /myApi/ {
proxy_pass http://xbh-halo2:8090/;
}
}
后端
halo:
console:
proxy:
endpoint: http://xbh2-front:3000/
enabled: true
uc:
proxy:
endpoint: http://xbh2-front:4000/
enabled: true
但是这样路径还是会出现错误