mirror of
https://github.com/fcwu/docker-ubuntu-vnc-desktop
synced 2026-08-05 16:12:41 +02:00
fix(websocket): RELATIVE_URL_ROOT not works on websockify (#157)
This commit is contained in:
@@ -13,28 +13,30 @@ server {
|
|||||||
root /usr/local/lib/web/frontend/;
|
root /usr/local/lib/web/frontend/;
|
||||||
index index.html index.htm;
|
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_location /_RELATIVE_URL_ROOT_/ {
|
||||||
#_RELATIVE_URL_ROOT_ rewrite /_RELATIVE_URL_ROOT_/(.*) /$1 break;
|
#_RELATIVE_URL_ROOT_ rewrite /_RELATIVE_URL_ROOT_/(.*) /$1 break;
|
||||||
#_RELATIVE_URL_ROOT_ root /usr/local/lib/web/frontend/;
|
#_RELATIVE_URL_ROOT_ root /usr/local/lib/web/frontend/;
|
||||||
#_RELATIVE_URL_ROOT_}
|
#_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;
|
#_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_http_version 1.1;
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
proxy_set_header Connection "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;
|
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-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $remote_addr;
|
proxy_set_header X-Forwarded-For $remote_addr;
|
||||||
proxy_set_header Host $host;
|
proxy_set_header Host $host;
|
||||||
proxy_pass http://127.0.0.1:6079;
|
|
||||||
max_ranges 0;
|
max_ranges 0;
|
||||||
|
proxy_pass http://127.0.0.1:6079;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ priority=15
|
|||||||
directory=%HOME%
|
directory=%HOME%
|
||||||
command=/usr/bin/pcmanfm --desktop --profile LXDE
|
command=/usr/bin/pcmanfm --desktop --profile LXDE
|
||||||
user=%USER%
|
user=%USER%
|
||||||
|
stopwaitsecs=3
|
||||||
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
|
environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ export default {
|
|||||||
// console.trace()
|
// console.trace()
|
||||||
console.log(`connecting...`)
|
console.log(`connecting...`)
|
||||||
this.errorMessage = ''
|
this.errorMessage = ''
|
||||||
let websockifyPath = 'websockify'
|
let websockifyPath = location.pathname.substr(1) + 'websockify'
|
||||||
if (force || this.vncState === 'stopped') {
|
if (force || this.vncState === 'stopped') {
|
||||||
this.vncState = 'connecting'
|
this.vncState = 'connecting'
|
||||||
let hostname = window.location.hostname
|
let hostname = window.location.hostname
|
||||||
|
|||||||
Reference in New Issue
Block a user