I currently have an Elastic Beanstalk instance running with no load balancing, in future I'll be using Elastic Load Balancer.

My EB Instance is sitting behind an nginx proxy, I'm aware to fix this issue I could disable the nginx proxy, but this would affect me as I scaled the application in future.

I read an article online saying that if I added a .ebextensions folder in my application I would be able to add a file to enable web sockets to respond through the proxy but I have no luck.

When I check my EB logs, I can see that the inbound socket request is received, but nothing is sent back to the connecting client.

I have a 01_files.config file in my .ebextensions folder (that resides in the root of my application.

Its contents is:

    "/etc/nginx/conf.d/websocketupgrade.conf" :
        mode: "000755"
        owner: root
        group: root
        content: |
             proxy_set_header        Upgrade         $http_upgrade;
             proxy_set_header        Connection      "upgrade";

How am I able to get web sockets work through my EB instance without disabling the nginx proxy?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.