mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2026-05-14 01:44:12 -04:00
fix: Remove redundant localhost proxy_redirects and add static location handling in nginx configuration
This commit is contained in:
@@ -53,7 +53,6 @@ http {
|
||||
add_header Access-Control-Allow-Origin "$http_origin" always;
|
||||
# Ensure redirects from Django include the external host:port
|
||||
proxy_redirect http://127.0.0.1/ $scheme://$http_host/;
|
||||
proxy_redirect http://localhost/ $scheme://$http_host/;
|
||||
}
|
||||
|
||||
location ^~ /docs {
|
||||
@@ -71,7 +70,6 @@ http {
|
||||
add_header Access-Control-Allow-Credentials "true" always;
|
||||
add_header Access-Control-Allow-Origin "$http_origin" always;
|
||||
proxy_redirect http://127.0.0.1/ $scheme://$http_host/;
|
||||
proxy_redirect http://localhost/ $scheme://$http_host/;
|
||||
}
|
||||
|
||||
location ^~ /accounts {
|
||||
@@ -89,7 +87,6 @@ http {
|
||||
add_header Access-Control-Allow-Credentials "true" always;
|
||||
add_header Access-Control-Allow-Origin "$http_origin" always;
|
||||
proxy_redirect http://127.0.0.1/ $scheme://$http_host/;
|
||||
proxy_redirect http://localhost/ $scheme://$http_host/;
|
||||
}
|
||||
|
||||
location ^~ /admin {
|
||||
@@ -119,7 +116,17 @@ http {
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
proxy_redirect http://127.0.0.1/ $scheme://$http_host/;
|
||||
proxy_redirect http://localhost/ $scheme://$http_host/;
|
||||
}
|
||||
|
||||
location ^~ /static {
|
||||
proxy_pass http://django_upstream;
|
||||
proxy_set_header Host $http_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;
|
||||
proxy_set_header X-Forwarded-Host $http_host;
|
||||
proxy_set_header X-Forwarded-Port $server_port;
|
||||
proxy_redirect http://127.0.0.1/ $scheme://$http_host/;
|
||||
}
|
||||
|
||||
# Everything else to frontend (SvelteKit)
|
||||
|
||||
Reference in New Issue
Block a user