Skip to content

Instantly share code, notes, and snippets.

@skayred
Last active July 13, 2017 07:17
Show Gist options
  • Save skayred/b6af2c6b91097da8ba322178cb8912ab to your computer and use it in GitHub Desktop.
Save skayred/b6af2c6b91097da8ba322178cb8912ab to your computer and use it in GitHub Desktop.
# Monit configuration for Puma
# Service name: puma_maintenance-server_production
#
check process puma_maintenance-server_production
with pidfile "/home/rvm/www/maintenance-server/shared/tmp/pids/puma.pid"
start program = "/usr/bin/sudo -iu rvm /bin/bash -c 'cd /home/rvm/www/maintenance-server/current && /usr/local/rvm/bin/rvm 2.3.0 do bundle exec puma -C /home/rvm/www/maintenance-server/shared/puma.rb --daemon'"
stop program = "/usr/bin/sudo -iu rvm /bin/bash -c 'cd /home/rvm/www/maintenance-server/current && /usr/local/rvm/bin/rvm 2.3.0 do bundle exec pumactl -S /home/rvm/www/maintenance-server/shared/tmp/pids/puma.state stop'"
upstream server {
server unix:///home/rvm/www/maintenance-server/shared/tmp/sockets/puma.sock;
}
server {
client_max_body_size 25m;
listen 80; ## listen for ipv4
server_name maintenance.x01d.com;
root /home/rvm/www/maintenance-server/shared/public;
location / {
try_files $uri @proxy;
}
location @proxy {
proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_connect_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694
proxy_redirect off;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://server;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment