diff --git a/nginx/custom-nginx.conf b/nginx/custom-nginx.conf index 832dfc9f0..44fce7587 100644 --- a/nginx/custom-nginx.conf +++ b/nginx/custom-nginx.conf @@ -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/ { @@ -17,7 +17,7 @@ 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; @@ -25,12 +25,4 @@ server { 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; - } }