Skip to content

Instantly share code, notes, and snippets.

@raulanatol
Created April 12, 2016 08:27
Show Gist options
  • Save raulanatol/8642fc5519d8a8b89d7317d2d37b493d to your computer and use it in GitHub Desktop.
Save raulanatol/8642fc5519d8a8b89d7317d2d37b493d to your computer and use it in GitHub Desktop.
Configure nginx to accept websockets on AWS Elastic Beanstalk
files:
"/etc/nginx/conf.d/01_websockets.conf":
mode: "000644"
owner: root
group: root
content: |
upstream nodejs {
server 127.0.0.1:8081;
keepalive 256;
}
server {
listen 8080;
location / {
proxy_pass http://nodejs;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
"/opt/elasticbeanstalk/hooks/appdeploy/enact/41_remove_eb_nginx_confg.sh":
mode: "000755"
owner: root
group: root
content : |
mv /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf /etc/nginx/conf.d/00_elastic_beanstalk_proxy.conf.old
@maks-novikov
Copy link

hi, can you explain from where i get this file and where i need to put it if i use aws with parse server?

@niknokseyer
Copy link

Tried this but it wouldn't work. Still giving me the failed handshake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment