Skip to content

Commit

Permalink
config: Update nginx configuration to serve frontend files for root r…
Browse files Browse the repository at this point in the history
…equests
  • Loading branch information
drikusroor committed Feb 7, 2024
1 parent 6590540 commit 29a611c
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions nginx/custom-nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ server {
listen 80;

# Serve frontend files for root requests
# location / {
# root /usr/share/nginx/html;
# try_files $uri $uri/ /index.html;
# }
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
}

# Serve static files from the Django app
location /django_static/ {
Expand All @@ -17,20 +17,12 @@ server {
alias /nginx/upload/;
}

# Proxy all other requests to the Django app
# Proxy pass to the Django app
location /server/ {
proxy_pass http://server: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;
proxy_set_header X-Forwarded-Proto $scheme;
}

location / {
proxy_pass http://server: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;
proxy_set_header X-Forwarded-Proto $scheme;
}
}

0 comments on commit 29a611c

Please sign in to comment.