Skip to content

Instantly share code, notes, and snippets.

@Reagent992
Created August 28, 2023 18:54
Show Gist options
  • Save Reagent992/d68a1b2a114a702fbfacd8aaa733baed to your computer and use it in GitHub Desktop.
Save Reagent992/d68a1b2a114a702fbfacd8aaa733baed to your computer and use it in GitHub Desktop.
nginx.conf
server {
listen 80;
location /api/docs/ {
root /usr/share/nginx/html;
try_files $uri $uri/redoc.html;
}
location /api/ {
proxy_pass http://host.docker.internal:8000/api/;
proxy_set_header Host $host;
}
location /admin/ {
proxy_pass http://host.docker.internal:8000/admin/;
proxy_set_header Host $host;
}
location /media/ {
alias /media/;
}
location /static_backend/ {
alias /static_backend/;
}
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri /index.html;
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;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /var/html/frontend/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment