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
  • Select an option

  • Save mandado/2ab70a6e9c876b51b702 to your computer and use it in GitHub Desktop.

Select an option

Save mandado/2ab70a6e9c876b51b702 to your computer and use it in GitHub Desktop.

Revisions

  1. @davidcelis davidcelis revised this gist Apr 22, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx.conf
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ server {
    ssl_certificate /etc/ssl/example.com-unified.crt;
    ssl_certificate_key /etc/ssl/example.com.key;

    root /home/goodbrews/api/current/public;
    root /var/www/example.com/current/public;

    location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  2. @davidcelis davidcelis created this gist May 1, 2014.
    35 changes: 35 additions & 0 deletions nginx.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    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 /home/goodbrews/api/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;
    }