From 122f535e34fde91d7c8ade9c826e755c002d9ca9 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Sun, 26 Jun 2022 15:23:53 +0300 Subject: [PATCH] Fix API vhost in nginx container --- docker/development/nginx/default.conf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docker/development/nginx/default.conf b/docker/development/nginx/default.conf index 126df16b..3ff41fe0 100644 --- a/docker/development/nginx/default.conf +++ b/docker/development/nginx/default.conf @@ -3,10 +3,15 @@ server { listen [::]:443 ssl http2; server_name _API_DOMAIN_; + location / { # Using a variable here stops nginx from crashing if the dev container is restarted or becomes otherwise unavailable - set $backend_upstream devenv; - proxy_pass http://$backend_upstream:_API_PORT_; + set $backend_upstream "http://devenv:_API_PORT_"; + # Using a variable in proxy_pass also requires resolver to be set. + # This is the address of the internal docker compose DNS server. + resolver 127.0.0.11; + + proxy_pass $backend_upstream; client_max_body_size 200M; }