diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 8ca74bf..ac39ad6 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -62,26 +62,31 @@ services: - "traefik.enable=true" # Routing rule for /api + - "traefik.http.routers.django-api.entrypoints=websecure" - "traefik.http.routers.django-api.rule=Host(`batdetectai.kitware.com`) && PathPrefix(`/api`)" - "traefik.http.routers.django-api.service=django" - "traefik.http.routers.django-api.middlewares=django-middleware" # Routing rule for /admin + - "traefik.http.routers.django-admin.entrypoints=websecure" - "traefik.http.routers.django-admin.rule=Host(`batdetectai.kitware.com`) && PathPrefix(`/admin`)" - "traefik.http.routers.django-admin.service=django" - "traefik.http.routers.django-admin.middlewares=django-middleware" # Routing rule for /accounts + - "traefik.http.routers.django-accounts.entrypoints=websecure" - "traefik.http.routers.django-accounts.rule=Host(`batdetectai.kitware.com`) && PathPrefix(`/accounts`)" - "traefik.http.routers.django-accounts.service=django" - "traefik.http.routers.django-accounts.middlewares=django-middleware" # Routing rule for /oauth + - "traefik.http.routers.django-oauth.entrypoints=websecure" - "traefik.http.routers.django-oauth.rule=Host(`batdetectai.kitware.com`) && PathPrefix(`/oauth`)" - "traefik.http.routers.django-oauth.service=django" - "traefik.http.routers.django-oauth.middlewares=django-middleware" # Routing rule for /static + - "traefik.http.routers.django-static.entrypoints=websecure" - "traefik.http.routers.django-static.rule=Host(`batdetectai.kitware.com`) && PathPrefix(`/static`)" - "traefik.http.routers.django-static.service=django" - "traefik.http.routers.django-static.middlewares=django-middleware" diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 274fa8a..710ba91 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -18,58 +18,6 @@ http { root /usr/share/nginx/html; index index.html; try_files $uri $uri/ /index.html; - } - # Proxy API requests to Django - location /api { - proxy_pass http://django:8000/api; - 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; - proxy_redirect off; - } - location /oauth { - proxy_pass http://django:8000/oauth; - 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; - proxy_redirect off; - } - location /static { - proxy_pass http://django:8000/static; - 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; - proxy_redirect off; - } - - location /admin { - proxy_pass http://django:8000/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; - proxy_redirect off; - } - location /accounts { - proxy_pass http://django:8000/accounts; - 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; - proxy_redirect off; - } - - location /django-storage { - proxy_pass http://minio:9000/django-storage; - 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; - proxy_redirect off; - } - + } } }