fix(deploy): defer nginx upstream DNS until api is reachable
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,11 +4,14 @@ server {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://api:3000;
|
||||
set $api_upstream api:3000;
|
||||
proxy_pass http://$api_upstream;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
@@ -4,11 +4,15 @@ server {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# Docker 内置 DNS;避免 api 未就绪时启动失败
|
||||
resolver 127.0.0.11 valid=10s ipv6=off;
|
||||
|
||||
gzip on;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml;
|
||||
|
||||
location /api/ {
|
||||
proxy_pass http://api:3000;
|
||||
set $api_upstream api:3000;
|
||||
proxy_pass http://$api_upstream;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
@@ -17,7 +21,8 @@ server {
|
||||
}
|
||||
|
||||
location /uploads/ {
|
||||
proxy_pass http://api:3000;
|
||||
set $api_upstream api:3000;
|
||||
proxy_pass http://$api_upstream;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
|
||||
Reference in New Issue
Block a user