From a3741ab29d7e3bf06366d759172fc95f3d77e75a Mon Sep 17 00:00:00 2001 From: Marian Palkus Date: Mon, 28 Oct 2024 22:27:43 +0100 Subject: [PATCH] [devcontainers] Refactor Nginx configuration for serving static files Simplify the Nginx setup by removing the elements-nginx service and directly serving static files from the main Nginx container. Updated volume mounts and configuration to reflect these changes. --- deploy/docker-compose/devcontainer-nginx.conf | 10 ++-------- .../docker-compose/devcontainers-full-setup.yaml | 16 ++-------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/deploy/docker-compose/devcontainer-nginx.conf b/deploy/docker-compose/devcontainer-nginx.conf index 891138ace..48e3ddf7c 100644 --- a/deploy/docker-compose/devcontainer-nginx.conf +++ b/deploy/docker-compose/devcontainer-nginx.conf @@ -3,17 +3,11 @@ server { server_name hanko-quickstart; location /elements.js { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_pass http://elements-nginx/elements/elements.js; + root /usr/share/nginx/html/elements/; } location /sdk.modern.js { - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_set_header X-NginX-Proxy true; - proxy_pass http://elements-nginx/frontend-sdk/sdk.modern.js; + root /usr/share/nginx/html/frontend-sdk/; } location /backend/ { diff --git a/deploy/docker-compose/devcontainers-full-setup.yaml b/deploy/docker-compose/devcontainers-full-setup.yaml index 70c6da7cb..82f9c7733 100644 --- a/deploy/docker-compose/devcontainers-full-setup.yaml +++ b/deploy/docker-compose/devcontainers-full-setup.yaml @@ -60,18 +60,6 @@ services: target: /workspace networks: - intranet - elements-nginx: - image: nginx:1-alpine - depends_on: - elements: - condition: service_started - ports: - - 8089:80 - networks: - - intranet - volumes: - - ../../frontend/elements/dist/:/usr/share/nginx/html/elements/ - - ../../frontend/frontend-sdk/dist/:/usr/share/nginx/html/frontend-sdk/ quickstart: build: ../../quickstart ports: @@ -95,11 +83,11 @@ services: image: nginx volumes: - ./devcontainer-nginx.conf:/etc/nginx/conf.d/default.conf + - ../../frontend/elements/dist/:/usr/share/nginx/html/elements/ + - ../../frontend/frontend-sdk/dist/:/usr/share/nginx/html/frontend-sdk/ depends_on: hanko: condition: service_started - elements-nginx: - condition: service_started mail: condition: service_started quickstart: