Skip to content

Instantly share code, notes, and snippets.

@creationix
Created June 26, 2012 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save creationix/2996318 to your computer and use it in GitHub Desktop.
Save creationix/2996318 to your computer and use it in GitHub Desktop.
Upstart scripts for my various live sites
description "Run node server"
env PATH=/home/tim/nvm/v0.8.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
respawn
start on runlevel [23]
script
cd /home/tim/
exec node server.js > access.log 2>> error.log
end script
description "start and stop the node server"
version "1.0"
author "Tim Caswell"
# configuration variables.
env PATH=/home/tim/nvm/v0.6.15/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
env PORT=3001
respawn
start on runlevel [23]
script
cd /home/tim/nodebits.org
exec node server.js > access.log 2>> error.log
end script

upstream app_nodebits { server 127.0.0.1:3001; }

server { listen 0.0.0.0:80; server_name nodebits.org nodebits www.nodebits.org nodebits.com www.nodebits.com; access_log /var/log/nginx/nodebits.log;

location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true;

proxy_pass http://app_nodebits/; proxy_redirect off; } }

description "start and stop the node server"
version "1.0"
author "Tim Caswell"
# configuration variables.
env PATH=/home/tim/nvm/v0.6.15/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
env PORT=3002
respawn
start on runlevel [23]
script
cd /home/tim/nodemanual.org
exec node server.js > access.log 2>> error.log
end script
description "start and stop the node server"
version "1.0"
author "Tim Caswell"
# configuration variables.
env PATH=/home/tim/nvm/v0.6.15/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
env PORT=3003
respawn
start on runlevel [23]
script
cd /home/tim/snippets
exec node server.js > access.log 2>> error.log
end script
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment