Hosting piping-server on Dokku
easysoft2k15 opened this issue · 2 comments
I'm trying to setup piping-server in Dokku (Digital Ocean) for use it with piping-vnc-web
After deploy, the piping-server is working:
-
I can successfully browse http://my_dokku_ip
-
I can successfully exchange ASCII text with:
shell1: curl -sSN http://my_dokku_ip/test
shell2: echo "this is a test" | curl -sSNT - http://my_dokku_ip/test
But piping-vnc-web is not working.
The log I get in Dokku is:
2022/05/17 08:51:19 [error] 351780#351780: *37 upstream timed out (110: Connection timed out) while reading response header from upstream, client: client_ip, server: , request: "GET /s HTTP/1.1", upstream: "http://docker_internal_ip:5000/s", host: "my_dokku_ip", referrer: "http://localhost/"
If I try the same local machine setup and use the official server ppng.io, everything work well.
So there must be something wrong with my Dokku setup.
My local machine setup is as follow
- piping-vnc-web is served on my development machine on IIS 10
- vnc.html page is open in Chrome
- on a shell I have the following cmd:
curl -sSN http://my_dokku_ip/c | ncat 192.168.0.90 5900 | curl -sSNT - http://my_dokku_ip/s
My Dokku nginx config is as follow:
server {
listen [::]:80;
listen 80;access_log /var/log/nginx/a-access.log;
error_log /var/log/nginx/a-error.log;location / {
gzip on; gzip_min_length 1100; gzip_buffers 4 32k; gzip_types text/css text/javascript text/xml text/plain text/x-component application/javascript application/x-javascript application/json application/xml application/rss+xml font/truetype application/x-font-ttf font/opentype application/vnd.ms-fontobject image/svg+xml; gzip_vary on; gzip_comp_level 6; proxy_pass http://a-5000; proxy_http_version 1.1; proxy_read_timeout 60s; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $http_connection; proxy_set_header Host $http_host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Forwarded-Port $server_port; proxy_set_header X-Request-Start $msec;
}
include /home/dokku/a/nginx.conf.d/*.conf;error_page 400 401 402 403 405 406 407 408 409 410 411 412 413 414 415 416 417 418 420 422 423 424 426 428 429 431 444 449 450 451 /400-error.html;
location /400-error.html {
root /var/lib/dokku/data/nginx-vhosts/dokku-errors;
internal;
}error_page 404 /404-error.html;
location /404-error.html {
root /var/lib/dokku/data/nginx-vhosts/dokku-errors;
internal;
}error_page 500 501 502 503 504 505 506 507 508 509 510 511 /500-error.html;
location /500-error.html {
root /var/lib/dokku/data/nginx-vhosts/dokku-errors;
internal;
}}
upstream a-5000 {
server 172.17.0.2:5000;
}
Any help would be appreciated.
Thank You
I found a working nginx configuration here nginx. stream cuts off after a certain point
#617
Now I'm going to test it with lets encrypt.
I'll report back the results
Everything works fine also with HTTPS!
At the end the problems was solved adding these 3 line in the nginx.conf file:
client_max_body_size 0;
proxy_buffering off;
proxy_request_buffering off;
I guess this is necessary to keep the stream open.
Thanks to @ghost for posting his nginx.conf file: this solve my problem!