Trouble with Websockets on elastic beanstalk node js envirom

0

Hello everybody,

I am currently trying to integrate Websocket into my server running on an AWS Beanstalk NodeJS environment. Unfortunately I get the error message in the browser:
WebSocket connection to 'wss: // ***' failed: Error during WebSocket handshake: Unexpected response code: 404
Local (localhost) everything is running fine.

On the server side, I log the calls and see that the value "upgrade" has not been transferred in the header.

In the Beanstalk configuration, I have a Classic Load Balancer deposited with the following configuration:

  • Port 443
  • Protocol SSL
  • Instance port 80
  • Instance protocol TCP
  • SSL Certificate: ...

In my deployment package is next to the server also the following file: .ebextensions / WebSocketsUpgrade.conf
with the following content:
container_commands:
enable_websockets:
command: |
sed -i '/\sproxy_set_header\sConnection/c \
proxy_set_header Upgrade $http_upgrade;\
proxy_set_header Connection "upgrade";\
' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf

Have I missed something that needs to be configured?

Thanks a lot!

akor
gefragt vor 5 Jahren963 Aufrufe
1 Antwort
0

Hello, the problem is solved. It is an incorrect name of the config file, which has been adopted in many forums. The file name must be: WebSocketsUpgrade.config.

akor
beantwortet vor 5 Jahren

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen