nginx reverse proxy with cloudflare

denes44

New Member
Feb 25, 2023
1
0
1
Hi,

I've set up an nginx reverse proxy according to this: https://pve.proxmox.com/wiki/Web_Interface_Via_Nginx_Proxy
It is working fine locally, but if I use cloudflare to proxy the websockets are not working, and I cannot view the consoles. Does anybody occurred with this problem?
Other applications with websockets works fine.

This is the browser console output:
Code:
xtermjs: starting

main.js?version=4.16.0-3:116 WebSocket connection to 'wss://server1.example.com/api2/json/nodes/server1-pve/lxc/107/vncwebsocket?port=5900&vncticket=PVEVNC%[...]%3D%3D' failed:
success @ main.js?version=4.16.0-3:116
API2Request.xhr.onload @ util.js?version=4.16.0-3:105

Nginx configuration:
NGINX:
server { #server1 proxmox
    listen 443 ssl;
    server_name server1.example.com;

    include /etc/nginx/includes/proxy_ssl.conf;

    proxy_buffering off;
    proxy_redirect off;

    location / {
        include /etc/nginx/includes/proxy_proxmox.conf;
        
        proxy_pass https://192.168.2.100:8006/;
    }
}

proxy_proxmox.conf:
NGINX:
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_buffering off;
client_max_body_size 0;
proxy_connect_timeout  3600s;
proxy_read_timeout  3600s;
proxy_send_timeout  3600s;
send_timeout  3600s;