Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add local nginx #569

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ckan-backend-dev/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 27 additions & 0 deletions ckan-backend-dev/ckan/setup/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
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 /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;
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;
}
}
13 changes: 13 additions & 0 deletions ckan-backend-dev/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading