Created
July 6, 2016 23:03
-
-
Save MarceloAlves/cd15229c9fd204b56b97aeb910462ecf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files: | |
/etc/nginx/conf.d/proxy.conf: | |
content: | | |
client_max_body_size 25M; | |
server_names_hash_bucket_size 128; | |
upstream backend { | |
server unix:///var/run/puma/my_app.sock; | |
} | |
server { | |
listen 80; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
server_name ######-env.us-west-2.elasticbeanstalk.com | |
# prevents 502 bad gateway error | |
large_client_header_buffers 8 32k; | |
location / { | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_set_header X-NginX-Proxy true; | |
# prevents 502 bad gateway error | |
proxy_buffers 8 32k; | |
proxy_buffer_size 64k; | |
proxy_pass http://backend; | |
proxy_redirect off; | |
location /assets { | |
root /var/app/current/public; | |
} | |
# enables WS support | |
location /cable { | |
proxy_pass http://backend; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade "websocket"; | |
proxy_set_header Connection "Upgrade"; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
} | |
} | |
} | |
container_commands: | |
01restart_nginx: | |
command: "service nginx restart" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment