server {
    listen 80;
    server_name localhost;

    root /usr/share/nginx/html;
    index index.html;

    # 代理 /wap 接口
    location /wap/ {
        proxy_pass http://8.130.28.21:31090/wap/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    # 代理 /portal-service-server 接口
    location /portal-service-server/ {
        proxy_pass http://8.130.28.21:31090/portal-service-server/;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    # 静态资源和前端路由
    location / {
        try_files $uri $uri/ /index.html;
    }

    location ~* \.(?:ico|css|js|gif|jpe?g|png|woff2?)$ {
        expires 30d;
        access_log off;
        add_header Cache-Control "public";
    }
}