Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save killinit/a8f991d3ae1b49610578572e55a8575a to your computer and use it in GitHub Desktop.

Select an option

Save killinit/a8f991d3ae1b49610578572e55a8575a to your computer and use it in GitHub Desktop.

Revisions

  1. @rkjha rkjha revised this gist Aug 18, 2014. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions nginx-config-rails4-with-puma.conf
    Original file line number Diff line number Diff line change
    @@ -35,6 +35,4 @@ server {
    }

    ## Running puma
    # bundle exec puma -e production -d -b unix:///tmp/myapp_puma.sock -S /var/run/myapp_puma.state
    ## Restart | Stop puma
    # bundle exec pumactl -S /var/run/myapp_puma.state stop
    # bundle exec puma -e production -d -b unix:///tmp/myapp_puma.sock
  2. @rkjha rkjha revised this gist Aug 18, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion nginx-config-rails4-with-puma.conf
    Original file line number Diff line number Diff line change
    @@ -37,4 +37,4 @@ server {
    ## Running puma
    # bundle exec puma -e production -d -b unix:///tmp/myapp_puma.sock -S /var/run/myapp_puma.state
    ## Restart | Stop puma
    # bundle exec pumactl -S /var/run/myapp_puma.state
    # bundle exec pumactl -S /var/run/myapp_puma.state stop
  3. @rkjha rkjha revised this gist Aug 18, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion nginx-config-rails4-with-puma.conf
    Original file line number Diff line number Diff line change
    @@ -35,4 +35,6 @@ server {
    }

    ## Running puma
    ## bundle exec puma -e production -d -b unix:///tmp/myapp_puma.sock -S /var/run/myapp_puma.state
    # bundle exec puma -e production -d -b unix:///tmp/myapp_puma.sock -S /var/run/myapp_puma.state
    ## Restart | Stop puma
    # bundle exec pumactl -S /var/run/myapp_puma.state
  4. @rkjha rkjha renamed this gist Aug 18, 2014. 1 changed file with 0 additions and 0 deletions.
  5. @rkjha rkjha revised this gist Aug 18, 2014. 1 changed file with 52 additions and 0 deletions.
    52 changes: 52 additions & 0 deletions nginx-rails4-ssl-puma.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,52 @@
    upstream myapp_puma {
    server unix:/tmp/myapp_puma.sock fail_timeout=0;
    }

    # for redirecting to https version of the site
    server {
    listen 80;
    rewrite ^(.*) https://$host$1 permanent;
    }

    # for redirecting to non-www version of the site
    server {
    listen 80;
    server_name www.example.com;
    rewrite ^(.*) http://example.com$1 permanent;
    }


    server {
    listen 443 default ssl;
    server_name example.com;
    root /home/username/example.com/current/public;

    ssl on;
    ssl_certificate /home/username/.comodo_certs/example.com.crt;
    ssl_certificate_key /home/username/.comodo_certs/example.com.key;

    ssl_session_timeout 5m;

    ssl_protocols SSLv2 SSLv3 TLSv1;
    ssl_ciphers HIGH:!aNULL:!MD5;
    ssl_prefer_server_ciphers on;

    location ^~ /assets/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
    }

    try_files $uri/index.html $uri @myapp_puma;
    location @myapp_puma {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto https;
    proxy_redirect off;
    proxy_pass http://myapp_puma;
    }

    error_page 500 502 503 504 /500.html;
    client_max_body_size 4G;
    keepalive_timeout 10;
    }
  6. @rkjha rkjha revised this gist Aug 18, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion nginx-config-rails4-with-puma.conf
    Original file line number Diff line number Diff line change
    @@ -32,4 +32,7 @@ server {
    error_page 500 502 503 504 /500.html;
    client_max_body_size 4G;
    keepalive_timeout 10;
    }
    }

    ## Running puma
    ## bundle exec puma -e production -d -b unix:///tmp/myapp_puma.sock -S /var/run/myapp_puma.state
  7. @rkjha rkjha created this gist Aug 18, 2014.
    35 changes: 35 additions & 0 deletions nginx-config-rails4-with-puma.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    upstream myapp_puma {
    server unix:/tmp/myapp_puma.sock fail_timeout=0;
    }

    # for redirecting to non-www version of the site
    server {
    listen 80;
    server_name www.example.com;
    rewrite ^(.*) http://example.com$1 permanent;
    }

    server {
    listen 80 default;
    server_name example.com;
    root /home/username/example.com/current/public;

    location ^~ /assets/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
    }

    try_files $uri/index.html $uri @myapp_puma;
    location @myapp_puma {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto http;
    proxy_redirect off;
    proxy_pass http://myapp_puma;
    }

    error_page 500 502 503 504 /500.html;
    client_max_body_size 4G;
    keepalive_timeout 10;
    }