Update ingress.conf

This commit is contained in:
Alexandre
2022-06-30 12:11:22 +02:00
committed by GitHub
parent 6f61cc8c35
commit b54cb201b4

View File

@@ -9,10 +9,12 @@ server
location / location /
{ {
# Security # Security
######################
allow 172.30.32.2; allow 172.30.32.2;
deny all; deny all;
# Base # Base
######################
proxy_bind $server_addr; proxy_bind $server_addr;
proxy_pass http://127.0.0.1:8080; proxy_pass http://127.0.0.1:8080;
proxy_set_header Connection "Upgrade"; proxy_set_header Connection "Upgrade";
@@ -20,16 +22,19 @@ server
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Allow ingress subpath # Allow subpath
######################
proxy_set_header X-Script-Name %%ingress_entry%%; # IMPORTANT: path has NO trailing slash proxy_set_header X-Script-Name %%ingress_entry%%; # IMPORTANT: path has NO trailing slash
proxy_cookie_path / %%ingress_entry%%/; proxy_cookie_path / %%ingress_entry%%/;
# Allow iframe # Allow iframe
######################
proxy_hide_header X-Frame-Options; proxy_hide_header X-Frame-Options;
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
proxy_set_header Accept-Encoding ""; proxy_set_header Accept-Encoding "";
# Avoid mixed contents # Avoid mixed contents
######################
if ($http_referer ~* "^(http[s]?)://([^:]+):(\d*)(/.*)$") if ($http_referer ~* "^(http[s]?)://([^:]+):(\d*)(/.*)$")
{ {
set $x_scheme $1; set $x_scheme $1;
@@ -47,6 +52,7 @@ server
proxy_redirect $x_scheme://$host/ $x_scheme://$x_host$x_port/; proxy_redirect $x_scheme://$host/ $x_scheme://$x_host$x_port/;
# Rewrite url # Rewrite url
######################
sub_filter_once off; sub_filter_once off;
sub_filter_types *; sub_filter_types *;
sub_filter "/static" "%%ingress_entry%%/static"; sub_filter "/static" "%%ingress_entry%%/static";
@@ -56,10 +62,10 @@ server
#sub_filter "/edit/" "%%ingress_entry%%/edit/"; #sub_filter "/edit/" "%%ingress_entry%%/edit/";
# Tests # Tests
######################
#proxy_set_header X-Real-IP $remote_addr; #proxy_set_header X-Real-IP $remote_addr;
#proxy_set_header X-Forwarded-Host $server_name; #proxy_set_header X-Forwarded-Host $server_name;
#proxy_set_header X-Forwarded-Proto $scheme; #proxy_set_header X-Forwarded-Proto $scheme;
} }
} }