mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-04 00:01:36 +01:00
Update ingress.conf
This commit is contained in:
@@ -30,5 +30,27 @@ server {
|
||||
add_header X-Frame-Options SAMEORIGIN;
|
||||
add_header Access-Control-Allow-Origin *;
|
||||
proxy_set_header Accept-Encoding "";
|
||||
|
||||
# avoid mixed content
|
||||
# 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_set_header X-Forwarded-Proto $x_scheme;
|
||||
|
||||
# Correct url without port when using https
|
||||
sub_filter_once off;
|
||||
sub_filter_types *;
|
||||
sub_filter https://$host/ $x_scheme://$host$x_port/;
|
||||
sub_filter http://$host/ $x_scheme://$host$x_port/;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user