diff --git a/docker/env/example.env b/docker/env/example.env index 1f504441..eeb9cccd 100644 --- a/docker/env/example.env +++ b/docker/env/example.env @@ -18,7 +18,7 @@ FE_PORT="1234" HTTP_PORT="1234" HTTPS_PORT="1234" -BASE_URL="task-backend" +BASE_URL="http://task-backend:${BACKEND_SERVER_PORT}" JVM_PROPERTIES="" diff --git a/docker/env/hetzner.env b/docker/env/hetzner.env index c0a28f48..903828df 100644 --- a/docker/env/hetzner.env +++ b/docker/env/hetzner.env @@ -16,7 +16,7 @@ FE_PORT="8050" HTTP_PORT="8050" HTTPS_PORT="8443" -BASE_URL="http://168.119.116.47:${BACKEND_PORT}" +BASE_URL="http://task-backend::${BACKEND_SERVER_PORT}" JVM_PROPERTIES="$JVM_PROPERTIES" diff --git a/docker/task-fe/nginx.conf b/docker/task-fe/nginx.conf index d96a3448..567d455a 100644 --- a/docker/task-fe/nginx.conf +++ b/docker/task-fe/nginx.conf @@ -7,7 +7,6 @@ server { access_log /var/log/nginx/access.log combinedwithport; listen 443 ssl; - listen [::]:443 ssl; server_name _; sendfile on; @@ -32,16 +31,19 @@ server { root /usr/share/nginx/html; + location /task-backend/ { # Assumes task-backend is the backend container name, might be good candidate to inject value + rewrite ^/task-backend(/.*)$ $1 break; # Remove /task-backend from the URL + proxy_pass $BASE_URL; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + + } + location / { index index.html; try_files $uri $uri/ /index.html?$args; } - location /task-backend/ { # Assumes task-backend is the backend container name, might be good candidate to inject value - proxy_pass $BASE_URL; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-Forwarded-Proto $scheme; - } }