Fix nginx DNS resolver for Docker upstream
Use Docker internal DNS resolver and variable for backend upstream to prevent nginx from failing to resolve hostname during config reload.
This commit is contained in:
parent
38ddfb00e3
commit
1f7f722238
1 changed files with 5 additions and 1 deletions
|
|
@ -4,9 +4,13 @@ server {
|
|||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# DNS resolver for Docker
|
||||
resolver 127.0.0.11 valid=30s;
|
||||
|
||||
# API proxy
|
||||
location /api {
|
||||
proxy_pass http://veridian-preview-backend:3000;
|
||||
set $backend_upstream "veridian-preview-backend:3000";
|
||||
proxy_pass http://$backend_upstream;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue