diff --git a/rootfs/etc/nginx/sites-enabled/default b/rootfs/etc/nginx/sites-enabled/default index 7b7e538..b6afe51 100644 --- a/rootfs/etc/nginx/sites-enabled/default +++ b/rootfs/etc/nginx/sites-enabled/default @@ -13,28 +13,30 @@ server { root /usr/local/lib/web/frontend/; index index.html index.htm; - location ~ /api/ { - try_files $uri @api; - } - - location ~ /resize$ { - try_files $uri @api; - } - #_RELATIVE_URL_ROOT_location /_RELATIVE_URL_ROOT_/ { #_RELATIVE_URL_ROOT_ rewrite /_RELATIVE_URL_ROOT_/(.*) /$1 break; #_RELATIVE_URL_ROOT_ root /usr/local/lib/web/frontend/; #_RELATIVE_URL_ROOT_} - location ~ /websockify$ { + location ~ .*/(api/.*|websockify) { + try_files $uri @api$http_upgrade; + } + + location / { + rewrite /approot/(.*) /$1 break; + root /usr/local/lib/web/frontend/; + } + + location @apiwebsocket { #_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 break; + proxy_connect_timeout 7d; + proxy_send_timeout 7d; + proxy_read_timeout 7d; + proxy_buffering off; + proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; - proxy_buffering off; - proxy_connect_timeout 7d; - proxy_send_timeout 7d; - proxy_read_timeout 7d; proxy_pass http://127.0.0.1:6081; } @@ -43,8 +45,8 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Host $host; - proxy_pass http://127.0.0.1:6079; max_ranges 0; + proxy_pass http://127.0.0.1:6079; } } diff --git a/rootfs/etc/supervisor/conf.d/supervisord.conf b/rootfs/etc/supervisor/conf.d/supervisord.conf index 1232efa..fc48e6d 100644 --- a/rootfs/etc/supervisor/conf.d/supervisord.conf +++ b/rootfs/etc/supervisor/conf.d/supervisord.conf @@ -38,6 +38,7 @@ priority=15 directory=%HOME% command=/usr/bin/pcmanfm --desktop --profile LXDE user=%USER% +stopwaitsecs=3 environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%" diff --git a/web/src/components/Vnc.vue b/web/src/components/Vnc.vue index 21eb80f..d239943 100644 --- a/web/src/components/Vnc.vue +++ b/web/src/components/Vnc.vue @@ -136,7 +136,7 @@ export default { // console.trace() console.log(`connecting...`) this.errorMessage = '' - let websockifyPath = 'websockify' + let websockifyPath = location.pathname.substr(1) + 'websockify' if (force || this.vncState === 'stopped') { this.vncState = 'connecting' let hostname = window.location.hostname