server { listen 3000; server_name _; root /usr/share/nginx/html; index index.html; location = /api/health { default_type text/plain; add_header Content-Type text/plain; return 200 "ok"; } # A 站无公网域名:浏览器只访问 B 站,由 B 反代到集群内 project57 location /embed/ { proxy_pass ${A_UPSTREAM}/embed/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location /images/ { proxy_pass ${A_UPSTREAM}/images/; proxy_http_version 1.1; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location = /api/contact { proxy_pass ${A_UPSTREAM}/api/contact; proxy_http_version 1.1; proxy_set_header Host $host; 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; } }