Last active
August 29, 2015 14:05
-
-
Save forrestgrant/83d798464fd8265828e3 to your computer and use it in GitHub Desktop.
nginx/puma config
This file contains hidden or 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
# /etc/nginx/sites-available/app.conf | |
upstream app { | |
server unix:///var/www/app/tmp/sockets/puma.sock fail_timeout=0; | |
} | |
server { | |
listen 80; | |
server_name localhost; | |
root /var/www/app/public; | |
try_files $uri/index.html $uri @app; | |
location @app { | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header Host $http_host; | |
proxy_redirect off; | |
proxy_pass http://app; | |
} | |
error_page 500 502 503 504 /500.html; | |
client_max_body_size 4G; | |
keepalive_timeout 10; | |
} |
This file contains hidden or 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
# /var/www/app/config/puma.rb | |
APP_PATH = '/var/www/app' | |
environment ENV['RAILS_ENV'] || 'production' | |
daemonize true | |
pidfile "#{APP_PATH}/tmp/pids/puma.pid" | |
stdout_redirect "#{APP_PATH}/log/production.log", "#{APP_PATH}/log/production.log" | |
threads 0, 16 | |
bind "unix:///#{APP_PATH}/tmp/sockets/puma.sock" |
This file contains hidden or 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
to start puma | |
$ cd /var/www/app | |
$ bundle exec puma |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment