mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-25 10:11:53 +02:00
Test mixed content
This commit is contained in:
@@ -33,5 +33,24 @@ server {
|
|||||||
allow 172.30.32.2;
|
allow 172.30.32.2;
|
||||||
deny all;
|
deny all;
|
||||||
proxy_pass http://127.0.0.1:80;
|
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/;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user