From 0ef207905da066fa76b68d163865f1c515f23d96 Mon Sep 17 00:00:00 2001 From: Drikus Roor Date: Wed, 7 Feb 2024 19:02:13 +0100 Subject: [PATCH] config: Update nginx configuration to serve frontend files for root requests --- nginx/custom-nginx.conf | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/nginx/custom-nginx.conf b/nginx/custom-nginx.conf index 832dfc9f0..a6fdc59cd 100644 --- a/nginx/custom-nginx.conf +++ b/nginx/custom-nginx.conf @@ -1,11 +1,11 @@ server { listen 80; - # Serve frontend files for root requests - # location / { - # root /usr/share/nginx/html; - # try_files $uri $uri/ /index.html; - # } + Serve frontend files for root requests + location / { + root /usr/share/nginx/html; + try_files $uri $uri/ /index.html; + } # Serve static files from the Django app location /django_static/ { @@ -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; - } }