From 51b224157430d30e73d3ecf1fce3a422ab53bcc9 Mon Sep 17 00:00:00 2001 From: Michael Polidori Date: Wed, 23 Oct 2024 08:46:16 -0400 Subject: [PATCH 1/3] Add nginx for local subpaths --- ckan-backend-dev/ckan/setup/nginx.conf | 19 +++++++++++++++++++ ckan-backend-dev/docker-compose.dev.yml | 13 +++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 ckan-backend-dev/ckan/setup/nginx.conf diff --git a/ckan-backend-dev/ckan/setup/nginx.conf b/ckan-backend-dev/ckan/setup/nginx.conf new file mode 100644 index 000000000..9ce1d57d9 --- /dev/null +++ b/ckan-backend-dev/ckan/setup/nginx.conf @@ -0,0 +1,19 @@ +server { + listen 3001; + + location /private-admin/ { + proxy_pass http://ckan-dev:5000/private-admin/; + 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 / { + proxy_pass http://host.docker.internal:3000/; + 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; + } +} diff --git a/ckan-backend-dev/docker-compose.dev.yml b/ckan-backend-dev/docker-compose.dev.yml index 1077a1736..78709a70c 100755 --- a/ckan-backend-dev/docker-compose.dev.yml +++ b/ckan-backend-dev/docker-compose.dev.yml @@ -179,3 +179,16 @@ services: restart: unless-stopped healthcheck: test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:8025/"] + + nginx: + image: nginx:latest + container_name: nginx-redirect + ports: + - "3001:3001" + volumes: + - ./ckan/setup/nginx.conf:/etc/nginx/conf.d/default.conf + depends_on: + - ckan-dev + restart: unless-stopped + extra_hosts: + - "host.docker.internal:host-gateway" From 113b72f51e60c4f82a8a1d7ecc2c8bfb36d612ed Mon Sep 17 00:00:00 2001 From: Michael Polidori Date: Wed, 23 Oct 2024 10:04:39 -0400 Subject: [PATCH 2/3] Update nginx for api --- ckan-backend-dev/.env.example | 4 ++-- ckan-backend-dev/ckan/setup/nginx.conf | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ckan-backend-dev/.env.example b/ckan-backend-dev/.env.example index aca3aff9d..4f5b4fe66 100644 --- a/ckan-backend-dev/.env.example +++ b/ckan-backend-dev/.env.example @@ -132,8 +132,8 @@ CKAN__CORS__ORIGIN_ALLOW_ALL = True # Frontend Creds NEXTAUTH_SECRET=secret NEXTAUTH_URL=http://frontend:3000 -CKAN_URL=http://ckan-dev:5000/private-admin/en -NEXT_PUBLIC_CKAN_URL=http://ckan-dev:5000/private-admin/en +CKAN_URL=http://ckan-dev:3001/private-admin/en +NEXT_PUBLIC_CKAN_URL=http://ckan-dev:3001/private-admin/en NEXT_PUBLIC_NEXTAUTH_URL=http://frontend:3000 NEXT_PUBLIC_GTM_ID=GTM-XXXXXX NEXT_PUBLIC_HOTJAR_ID=xxxxxxx diff --git a/ckan-backend-dev/ckan/setup/nginx.conf b/ckan-backend-dev/ckan/setup/nginx.conf index 9ce1d57d9..71c3685f0 100644 --- a/ckan-backend-dev/ckan/setup/nginx.conf +++ b/ckan-backend-dev/ckan/setup/nginx.conf @@ -9,6 +9,14 @@ server { proxy_set_header X-Forwarded-Proto $scheme; } + location /api/action { + proxy_pass http://ckan-dev:5000/api/3/action; + 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 / { proxy_pass http://host.docker.internal:3000/; proxy_set_header Host $host; From 3fae64d3e7f8a9bd192d96f206c26b18de5e01db Mon Sep 17 00:00:00 2001 From: Michael Polidori Date: Wed, 23 Oct 2024 14:48:39 -0400 Subject: [PATCH 3/3] Force rerun pipeline