gusavila92 / java-android-websocket-client

Java/Android WebSocket Client
Apache License 2.0
148 stars 40 forks source link

Connection issue to websocket server behind nginx reverse proxy #9

Closed blumfontein closed 5 years ago

blumfontein commented 6 years ago

Hello

I have a websocket server, written on php Ratchet, behind nginx reverse proxy (configured as shown here http://nginx.org/en/docs/http/websocket.html ). When I connect straight to websocket server bypassing nginx, it works. But when I connect through nginx, it fails with message "tech.gusavila92.apache.http.NoHttpResponseException: The target server failed to respond".

Reverse proxy configured well, because other websocket clients like autobahn work. What can go wrong?

Thank you

gusavila92 commented 6 years ago

Hi. I was unable to reproduce the error locally. Can you give more details like if you're using SSL, if a redirect is being made with Nginx, did you manage to connect to the server or the error is being triggered after a while?, how many simultaneous connections are you doing?, what's the value of your keepalive attribute?

This can help me to identify the problem, because I've used this library with a Nginx proxy before without any problems so far.