Last active
December 14, 2015 19:49
-
-
Save jalaziz/5139257 to your computer and use it in GitHub Desktop.
Graphiti Upstart + Unicorn + Nginx
This file contains 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
description "Graphiti" | |
start on runlevel [2345] | |
stop on runlevel [06] | |
respawn limit 10 5 | |
chdir /opt/graphiti | |
kill signal QUIT | |
exec bundle exec unicorn -c config/unicorn.rb -E production |
This file contains 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
*/5 * * * * cd /opt/graphiti && PATH=$PATH:/usr/local/bin bundle exec rake graphiti:metrics |
This file contains 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
server { | |
listen 80 default_server deferred; | |
charset utf-8; | |
access_log /var/log/nginx/graphiti.access.log; | |
error_log /var/log/nginx/graphiti.error.log; | |
root /opt/graphiti/public; | |
try_files $uri/index.html $uri.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://localhost:5001; | |
} | |
} |
This file contains 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
listen 5001 # by default Unicorn listens on port 8080 | |
worker_processes 2 # this should be >= nr_cpus | |
pid "/var/run/graphiti.pid" | |
stderr_path "/opt/graphiti/shared/log/unicorn.log" | |
stdout_path "/opt/graphiti/shared/log/unicorn.log" | |
user "graphite", "graphite" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment