Files
project57-x/nginx.conf
T
mdszxy 8a28342a81
CI Pipeline / check-commit (push) Successful in 6s
CI Pipeline / deploy-only (push) Has been skipped
CI Pipeline / build (push) Successful in 22s
CI Pipeline / deploy (push) Successful in 19s
fix: proxy embed to A public host with correct Host/SNI [deploy]
2026-10-06 00:17:49 +08:00

54 lines
1.5 KiB
Nginx Configuration File

server {
listen 3000;
server_name _;
root /usr/share/nginx/html;
index index.html;
# 入口脚本写入集群 DNS;变量 proxy_pass 必须配合 resolver
resolver __RESOLVER__ valid=10s ipv6=off;
location = /api/health {
default_type text/plain;
add_header Content-Type text/plain;
return 200 "ok";
}
# 反代到 A 站(默认公网域名;也可改成集群内 Service)
location /embed/ {
set $a_upstream __A_UPSTREAM__;
proxy_pass $a_upstream$request_uri;
proxy_http_version 1.1;
proxy_ssl_server_name on;
proxy_set_header Host __A_HOST__;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location /images/ {
set $a_upstream __A_UPSTREAM__;
proxy_pass $a_upstream$request_uri;
proxy_http_version 1.1;
proxy_ssl_server_name on;
proxy_set_header Host __A_HOST__;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location = /api/contact {
set $a_upstream __A_UPSTREAM__;
proxy_pass $a_upstream$request_uri;
proxy_http_version 1.1;
proxy_ssl_server_name on;
proxy_set_header Host __A_HOST__;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
}
location / {
try_files $uri $uri/ /index.html;
}
}