Skip to content

Commit

Permalink
update nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
BryonLewis committed Feb 20, 2024
1 parent 3cbeba1 commit 4037929
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 53 deletions.
5 changes: 5 additions & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
54 changes: 1 addition & 53 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
}
}

0 comments on commit 4037929

Please sign in to comment.