From d2fca3324dfa2a7a966dce0bb17850401289f672 Mon Sep 17 00:00:00 2001 From: Roger Joys Date: Sun, 15 Mar 2026 16:03:25 -0700 Subject: [PATCH] Added NGINX to proxy due to limitations on Unifi External Portal Config --- docker-compose.yml | 14 +++++++++++--- nginx.conf | 9 +++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 nginx.conf diff --git a/docker-compose.yml b/docker-compose.yml index 0f26ea7..6c5b036 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,9 +2,17 @@ services: portal: build: . restart: unless-stopped - ports: - - "8080:8000" env_file: - .env + expose: + - "8000" + + nginx: + image: nginx:alpine + restart: unless-stopped + ports: + - "80:80" volumes: - - ./app/static:/app/app/static + - ./nginx.conf:/etc/nginx/conf.d/default.conf + depends_on: + - portal \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..59b837a --- /dev/null +++ b/nginx.conf @@ -0,0 +1,9 @@ +server { + listen 80; + location / { + proxy_pass http://portal:8000; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + } +}