Skip to content

Instantly share code, notes, and snippets.

@chsh
Created May 31, 2015 07:21
Show Gist options
  • Save chsh/38711a075511879d863b to your computer and use it in GitHub Desktop.
Save chsh/38711a075511879d863b to your computer and use it in GitHub Desktop.
AWS Elastic Beanstalk nginx webapp.conf for ruby(rails).
upstream my_app {
server unix:///var/run/puma/my_app.sock;
}
server {
listen 80;
server_name _ localhost; # need to listen to localhost for worker tier
location / {
proxy_pass http://my_app; # match the name of upstream directive which is defined above
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /assets {
alias /var/app/current/public/assets;
gzip_static on;
gzip on;
expires max;
add_header Cache-Control public;
}
location /public {
alias /var/app/current/public;
gzip_static on;
gzip on;
expires max;
add_header Cache-Control public;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment