Skip to content

Instantly share code, notes, and snippets.

@mandado
Forked from davidcelis/nginx.conf
Last active August 29, 2015 14:19
Show Gist options
  • Save mandado/2ab70a6e9c876b51b702 to your computer and use it in GitHub Desktop.
Save mandado/2ab70a6e9c876b51b702 to your computer and use it in GitHub Desktop.
upstream puma {
server unix:///var/www/app/shared/tmp/sockets/puma.sock fail_timeout=0;
}
server {
listen 80 default deferred;
server_name example.com;
rewrite ^/(.+) https://example.com/$1 permanent;
}
server {
listen 443 ssl spdy;
server_name example.com;
ssl_certificate /etc/ssl/example.com-unified.crt;
ssl_certificate_key /etc/ssl/example.com.key;
root /var/www/example.com/current/public;
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header Host $http_host;
proxy_redirect off;
if (-f $request_filename) {
break;
}
proxy_pass http://puma;
}
client_max_body_size 4G;
keepalive_timeout 10;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment