mirror of
https://github.com/inventree/InvenTree.git
synced 2026-12-03 12:51:34 +00:00
Forward the host header in nginx auth requests (#13417)
The /auth subrequest used to check access to media files did not set the Host header, so it reached the server as the upstream address (e.g. inventree-server:8000 or localhost:6000). When that address is not in ALLOWED_HOSTS, the server rejects the request with a 400 error, which nginx returns as a 500 error for every media file.
This commit is contained in:
1 parent
28f914e088
commit
b9cc1d1b09
2 files changed
+6
No files matched your search
@@ -65,6 +65,9 @@ server {
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
proxy_set_header X-Original-URI $request_uri;
|
||||
|
||||
# Forward the original host header, so that it matches ALLOWED_HOSTS
|
||||
proxy_set_header Host $http_host;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -62,6 +62,9 @@ server {
|
||||
proxy_pass_request_body off;
|
||||
proxy_set_header Content-Length "";
|
||||
proxy_set_header X-Original-URI $request_uri;
|
||||
|
||||
# Forward the original host header, so that it matches ALLOWED_HOSTS
|
||||
proxy_set_header Host $http_host;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user