mirror of
https://github.com/lildude/ha-addon-teslamate.git
synced 2026-10-13 21:19:16 -04:00
Add Ingress Support (#1)
* Add ingress support * Development framework * Add ARCH arg for correct s6 version * Support new ARCH arg for correct s6 overlay version * Add PR trigger to workflow * Add image again Co-authored-by: Matt White <matt.white@microsoft.com>
This commit is contained in:
co-authored by
Matt White
parent
0a82b9eba8
commit
d544873055
@@ -0,0 +1,42 @@
|
||||
# Enable gzipping of responses.
|
||||
gzip on;
|
||||
|
||||
map $http_upgrade $connection_upgrade {
|
||||
default upgrade;
|
||||
'' close;
|
||||
}
|
||||
|
||||
server {
|
||||
server_name _;
|
||||
listen 8099 default_server;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:4000/;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection $connection_upgrade;
|
||||
proxy_set_header Host $host;
|
||||
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_set_header Referer $http_referer;
|
||||
|
||||
# Disable encoding to allow the sub_filter to work
|
||||
proxy_set_header Accept-Encoding "";
|
||||
|
||||
# Enable sub-filtering
|
||||
sub_filter_types text/css text/xml application/javascript;
|
||||
sub_filter_once off;
|
||||
|
||||
# Home URLs in the HTML
|
||||
sub_filter 'href="/"' 'href="$http_x_ingress_path/"';
|
||||
|
||||
# Fonts in the CSS
|
||||
sub_filter 'url(/' 'url($http_x_ingress_path/';
|
||||
|
||||
# Update fixed paths in the .js files
|
||||
sub_filter '"/live"' '"$http_x_ingress_path/live"';
|
||||
sub_filter '"/js/"' '"$http_x_ingress_path/js/"';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user