mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
nixos/inventree: fix duplicate Host header causing Django DisallowedHost
(cherry picked from commit f780384415)
This commit is contained in:
parent
0d6d05401d
commit
d3435ba3ec
1 changed files with 7 additions and 4 deletions
|
|
@ -252,12 +252,13 @@ in
|
|||
in
|
||||
{
|
||||
"/" = {
|
||||
# recommendedProxySettings sets the standard headers (Host, X-Forwarded-*), so
|
||||
# don't also set them via proxy_set_header in extraConfig below. Nginx would then
|
||||
# send Host twice and Django rejects it with DisallowedHost. Enabled per-location
|
||||
# so it works even if the host's global recommendedProxySettings is off.
|
||||
recommendedProxySettings = true;
|
||||
extraConfig = ''
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-By $server_addr:$server_port;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header CLIENT_IP $remote_addr;
|
||||
|
||||
proxy_pass_request_headers on;
|
||||
|
|
@ -272,6 +273,8 @@ in
|
|||
proxyPass = "http://unix:${unixPath}";
|
||||
};
|
||||
"/auth" = {
|
||||
# same reasoning as "/"; this subrequest also reaches Django
|
||||
recommendedProxySettings = true;
|
||||
extraConfig = ''
|
||||
internal;
|
||||
proxy_pass_request_body off;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue