From d1d86c4e40538d432fa18fc08e1e6f8c75b44233 Mon Sep 17 00:00:00 2001 From: Theo <34158395+thetheodoros@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:07:15 +0200 Subject: [PATCH 1/3] Update default_site.conf --- rootfs/defaults/default_site.conf | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rootfs/defaults/default_site.conf b/rootfs/defaults/default_site.conf index 71413bf..e88485c 100644 --- a/rootfs/defaults/default_site.conf +++ b/rootfs/defaults/default_site.conf @@ -22,6 +22,11 @@ server { root /opt/novnc; index index.html; + + # Support serving application under path prefix. + location /sed_path_prefix { + rewrite ^/sed_path_prefix(.*)$ $1 last; + } location /websockify { proxy_pass http://127.0.0.1:5950; From db02ddf33cc0a364605b75a190bf84dd40dc352c Mon Sep 17 00:00:00 2001 From: Theo <34158395+thetheodoros@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:08:42 +0200 Subject: [PATCH 2/3] Update 10-nginx.sh --- rootfs/etc/cont-init.d/10-nginx.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rootfs/etc/cont-init.d/10-nginx.sh b/rootfs/etc/cont-init.d/10-nginx.sh index 5e36128..d6a69d8 100755 --- a/rootfs/etc/cont-init.d/10-nginx.sh +++ b/rootfs/etc/cont-init.d/10-nginx.sh @@ -15,6 +15,11 @@ if ! ifconfig -a | grep -wq inet6; then sed-patch '/^[\t]listen \[::\]:5800 /d' /etc/nginx/default_site.conf fi +# If environment Variable PATH_PREFIX is defined, replace it in virtual server configuration. +if [[ ! -z "${PATH_PREFIX:-}" ]]; then + sed-patch "s|/sed_path_prefix|$PATH_PREFIX|g" /etc/nginx/default_site.conf +fi + # Make sure required directories exist. s6-setuidgid $USER_ID:$GROUP_ID mkdir -p /config/log/nginx From 511d0e537e858221ac4f63cea8b4e12697f455f1 Mon Sep 17 00:00:00 2001 From: Theo <34158395+thetheodoros@users.noreply.github.com> Date: Wed, 7 Oct 2020 17:17:47 +0200 Subject: [PATCH 3/3] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3dfd332..6c90808 100644 --- a/README.md +++ b/README.md @@ -217,6 +217,8 @@ to the `docker run` command. |`VNC_PASSWORD`| Password needed to connect to the application's GUI. See the [VNC Password](#vnc-password) section for more details. | (unset) | |`X11VNC_EXTRA_OPTS`| Extra options to pass to the x11vnc server running in the Docker container. **WARNING**: For advanced users. Do not use unless you know what you are doing. | (unset) | |`ENABLE_CJK_FONT`| When set to `1`, open-source computer font `WenQuanYi Zen Hei` is installed. This font contains a large range of Chinese/Japanese/Korean characters. | `0` | +|`PATH_PREFIX`| Sets the path prefix under which the application can be served. Example: `PATH_PREFIX=/path/to/app` enables accessing the app via `example.com/path/to/app/` | (unset) | + ## Config Directory Inside the container, the application's configuration should be stored in the