server {
    listen       8001;
    server_name  localhost;

    root /usr/share/nginx/html/dist-vdsg;
    index index.html;

    # 静态文件配置
    location / {
        try_files $uri $uri/ /index.html;
    }

    # 代理 /api
    location /api {
        proxy_pass http://172.16.11.141:8106/vdsg;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    error_page 404 /index.html;
}

server {
    listen       8002;
    server_name  localhost;

    root /usr/share/nginx/html/dist-vdsg-service;
    index index.html;

    # 静态文件配置
    location / {
        try_files $uri $uri/ /index.html;
    }

    # 代理 /api 
    location /api {
        proxy_pass http://172.16.11.141:8107/vdsg;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    error_page 404 /index.html;
}

server {
    listen       8003;
    server_name  localhost;

    # 代理 /api
    location / {
        proxy_pass http://172.16.11.151:8108/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}
