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:
Thomas Moore
2021-01-08 14:24:13 +00:00
committed by GitHub
co-authored by Matt White
parent 0a82b9eba8
commit d544873055
15 changed files with 319 additions and 25 deletions
+2
View File
@@ -0,0 +1,2 @@
#!/bin/sh
s6-svscanctl -t /var/run/s6/services
+3
View File
@@ -0,0 +1,3 @@
#!/usr/bin/with-contenv sh
mkdir /run/nginx
exec nginx -g 'daemon off;'
+42
View File
@@ -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/"';
}
}