I’m having trouble getting Claper to work properly through Nginx Proxy Manager Plus. The application runs fine when I access it directly using the local IP address, but when I try to use it through the reverse proxy, I run into problems.
The main page loads without any issues, but I can’t upload presentations or cast votes. I keep getting this WebSocket error:
WebSocket connection to 'wss://claper.............' failed: There was a bad response from the server.
In my docker logs, I can see these entries when accessing through the proxy:
app-1 | 14:28:40.667 request_id=GFBNAMA5UUFak5kAAAlB [info] GET /
app-1 | 14:28:40.668 request_id=GFBNAMA5UUFak5kAAAlB [info] Sent 200 in 808µs
I’ve tried adding these configuration lines to my NPM+ setup:
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
client_body_buffer_size 512k;
proxy_read_timeout 86400s;
client_max_body_size 0;
I also enabled the WebSocket support toggle in the interface. Has anyone successfully configured Claper to work behind NPM+? What configuration changes are needed to fix the WebSocket connection issues?
had the same probs with claper too. just toggling websocket ain’t enough, ya gotta add proxy_set_header Host $host;
in yer config. also make sure the claper container has the correct external URL in the env vars, or it’ll get all mixed up.
I dealt with this same issue for days! The problem is Claper builds WebSocket URLs from request headers, so without proper forwarding, it creates broken endpoints. You need to add proxy_set_header X-Forwarded-Proto $scheme;
and proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
to your NPM+ config. But here’s the key part - check your Claper environment variables. Make sure CLAPER_URL
or PHX_HOST
matches your external domain exactly. If Claper thinks it’s on localhost while clients connect through your proxy domain, the WebSocket handshake fails every time.
Hit this exact same websocket nightmare with Claper behind NPM+ last month. It’s not just the proxy headers - Phoenix LiveView gets confused about the actual host too. Make sure you’ve got proxy_buffering off;
set, otherwise NPM+ buffers the websocket frames and kills the real-time connection. Also check for SSL cert issues between NPM+ and the Claper container. I had to add proxy_ssl_verify off;
because internal communication was failing SSL validation. Bump the log level to debug temporarily - the container logs will show more detailed Phoenix socket errors.