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
已提问 5 年前963 查看次数
1 回答
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
已回答 5 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则