Test mixed content

This commit is contained in:
Alexandre
2022-07-24 17:43:08 +02:00
committed by GitHub
parent 094ccdbd02
commit 9beef67d7d

View File

@@ -33,5 +33,24 @@ server {
allow 172.30.32.2;
deny all;
proxy_pass http://127.0.0.1:80;
# Ensure work with both http and https (code by @met67)
if ($http_referer ~* "^(http[s]?)://([^:]+):(\d*)(/.*)$") {
set $x_scheme $1;
set $x_host $2;
set $x_port ":$3";
}
# Ensure works if standard port (code by @met67)
if ($http_referer ~* "^(http[s]?)://([^:]+)(/.*)$") {
set $x_scheme $1;
set $x_host $2;
set $x_port "";
}
proxy_set_header X-Scheme $x_scheme;
proxy_redirect http://$host/ $x_scheme://$x_host$x_port/;
proxy_redirect $x_scheme://$host/ $x_scheme://$x_host$x_port/;
}
}