fix: start nginx without resolving A-site at boot [deploy]
CI Pipeline / check-commit (push) Successful in 5s
CI Pipeline / deploy-only (push) Has been skipped
CI Pipeline / build (push) Successful in 21s
CI Pipeline / deploy (push) Successful in 17s

This commit is contained in:
mdszxy committed 2026-10-05 20:16:16 +08:00
1 parent 9d5ea0b393
commit 5dc62bd7c4
4 files changed
+47 -11

No files matched your search

+9 -4
View File
@@ -4,15 +4,18 @@ server {
root /usr/share/nginx/html;
index index.html;
# 由入口脚本写入:集群 DNS + A 站地址。用变量做 proxy_pass,启动时不解析上游,A 站暂不可达也不会让 nginx 起不来。
resolver __RESOLVER__ valid=10s ipv6=off;
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/;
set $a_upstream __A_UPSTREAM__;
proxy_pass $a_upstream;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -20,7 +23,8 @@ server {
}
location /images/ {
proxy_pass ${A_UPSTREAM}/images/;
set $a_upstream __A_UPSTREAM__;
proxy_pass $a_upstream;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -28,7 +32,8 @@ server {
}
location = /api/contact {
proxy_pass ${A_UPSTREAM}/api/contact;
set $a_upstream __A_UPSTREAM__;
proxy_pass $a_upstream;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;