mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-30 10:34:31 +02:00
25 lines
920 B
Plaintext
25 lines
920 B
Plaintext
absolute_redirect off;
|
|
rewrite ^%%ingress_entry%%/(.*)$ /$1 break;
|
|
sub_filter_once off;
|
|
sub_filter_types *;
|
|
|
|
# Inject <base href> for Vue Router history mode and static asset loading
|
|
sub_filter '<head>' '<head><base href="%%ingress_entry%%/">';
|
|
|
|
# Rewrite absolute href/src attributes in HTML
|
|
sub_filter 'href="/' 'href="%%ingress_entry%%/';
|
|
sub_filter 'src="/' 'src="%%ingress_entry%%/';
|
|
|
|
# Rewrite API paths in JS bundles (axios baseURL and fetch calls)
|
|
# Pattern includes baseURL:"/api" (no trailing slash) so "/api" is needed
|
|
sub_filter '"/api' '"%%ingress_entry%%/api';
|
|
sub_filter "'/api" "'%%ingress_entry%%/api";
|
|
|
|
# Rewrite stream paths
|
|
sub_filter '"/stream/' '"%%ingress_entry%%/stream/';
|
|
sub_filter "'/stream/" "'%%ingress_entry%%/stream/";
|
|
|
|
# Rewrite Socket.IO default path in the client library
|
|
sub_filter '"/socket.io' '"%%ingress_entry%%/socket.io';
|
|
sub_filter "'/socket.io" "'%%ingress_entry%%/socket.io";
|