diff --git a/backend.conf.j2 b/backend.conf.j2 index 03a542a..4dbcee1 100644 --- a/backend.conf.j2 +++ b/backend.conf.j2 @@ -42,22 +42,29 @@ server { resolver 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=300s; {% endif %} - location ~ /(static|media)/ { - autoindex on; - root /backend/www; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Scheme $scheme; + + location / { + proxy_pass http://frontend:8080; } - location ~ /(api|admin) { + location /admin/ { proxy_pass http://backend:8000; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } - location / { - proxy_pass http://frontend:8080; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header Host $host; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + location /api/ { + proxy_pass http://backend:8000; } -} \ No newline at end of file + + location /static/ { + autoindex on; + root /backend/www; + } + + location /media/ { + autoindex on; + root /backend/www; + } +}