change subfolder behavior to push the websockify path to the subfolder

This commit is contained in:
thelamer 2024-02-14 11:19:42 -08:00
parent 8acbbed73d
commit e4dcdbfc2a
2 changed files with 4 additions and 2 deletions

View File

@ -25,7 +25,7 @@ server {
proxy_buffering off;
}
location /websockify {
location SUBFOLDERwebsockify {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
@ -77,7 +77,7 @@ server {
proxy_buffering off;
}
location /websockify {
location SUBFOLDERwebsockify {
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;

View File

@ -7,6 +7,7 @@ NGINX_CONFIG=/etc/nginx/conf.d/default.conf
CPORT="${CUSTOM_PORT:-3000}"
CHPORT="${CUSTOM_HTTPS_PORT:-3001}"
CUSER="${CUSTOM_USER:-abc}"
SFOLDER="${SUBFOLDER:-/}"
# create self signed cert
if [ ! -f "/config/ssl/cert.pem" ]; then
@ -24,6 +25,7 @@ fi
cp /defaults/default.conf ${NGINX_CONFIG}
sed -i "s/3000/$CPORT/g" ${NGINX_CONFIG}
sed -i "s/3001/$CHPORT/g" ${NGINX_CONFIG}
sed -i "s|SUBFOLDER|$SFOLDER|g" ${NGINX_CONFIG}
if [ ! -z ${DISABLE_IPV6+x} ]; then
sed -i '/listen \[::\]/d' ${NGINX_CONFIG}
fi