Feedback refactored

This commit is contained in:
bartbutenaers 2025-03-09 23:00:30 +01:00
parent a4a23e366a
commit b513661379
4 changed files with 23 additions and 29 deletions

View File

@ -84,11 +84,6 @@ python3 /usr/local/nginx/get_base_path.py | \
tempio -template /usr/local/nginx/templates/base_path.gotmpl \
-out /usr/local/nginx/conf/base_path.conf
# build templates for optional base_path in web manifest
python3 /usr/local/nginx/get_base_path.py | \
tempio -template /usr/local/nginx/templates/web_manifest.gotmpl \
-out /usr/local/nginx/conf/web_manifest.conf
# build templates for optional TLS support
python3 /usr/local/nginx/get_tls_settings.py | \
tempio -template /usr/local/nginx/templates/listen.gotmpl \

View File

@ -300,7 +300,17 @@ http {
add_header Cache-Control "public";
}
include web_manifest.conf;
location ~ ^/.*-([A-Za-z0-9]+)\.webmanifest$ {
access_log off;
expires off;
add_header Cache-Control "public, must-revalidate" always;
default_type application/json;
proxy_set_header Accept-Encoding "";
sub_filter_once off;
sub_filter_types application/json;
sub_filter '"start_url": "/"' '"start_url" : "$http_x_ingress_path"';
sub_filter '"src": "/' '"src": "$http_x_ingress_path/';
}
sub_filter 'href="/BASE_PATH/' 'href="$http_x_ingress_path/';
sub_filter 'url(/BASE_PATH/' 'url($http_x_ingress_path/';

View File

@ -3,15 +3,17 @@ location = {{ .base_path }} {
return 302 {{ .base_path }}/;
}
location {{ .base_path }}/ {
proxy_http_version 1.1;
proxy_cache_bypass $http_upgrade;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_set_header Host $http_host;
proxy_set_header X-Ingress-Path {{ .base_path }};
proxy_set_header Authorization "";
proxy_pass http:/{{ .base_path }}:5000/;
access_log off;
location /{{ .base_path }}/ {
# remove base_url from the path before passing upstream
rewrite ^/{{ .base_path }}/(.*) /$1 break;
proxy_pass http://127.0.0.1:8971;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Ingress-Path /{{ .base_path }};
access_log off;
}
{{ end }}

View File

@ -1,13 +0,0 @@
{{ if .base_path }}
location ~ ^/.*-([A-Za-z0-9]+)\.webmanifest$ {
access_log off;
expires 1y;
add_header Cache-Control "public";
default_type application/json;
proxy_set_header Accept-Encoding "";
sub_filter_once off;
sub_filter_types application/json;
sub_filter '"start_url": "/"' '"start_url" : "{{ .base_path }}"';
sub_filter '"src": "/' '"src": "{{ .base_path }}/';
}
{{ end }}