Skip to content

Instantly share code, notes, and snippets.

@ammmir
Created November 30, 2010 07:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ammmir/721313 to your computer and use it in GitHub Desktop.
Save ammmir/721313 to your computer and use it in GitHub Desktop.
nginx and node deployment config
upstream myapp_new {
server unix:/tmp/myapp-new.sock;
}
upstream myapp_old {
server unix:/tmp/myapp-old.sock;
}
server {
location / {
error_page 502 503 504 = @failover;
proxy_next_upstream error timeout http_500 http_502 http_503 http_504 http_404;
proxy_intercept_errors on;
proxy_pass http://myapp_new;
break;
}
location @failover {
proxy_next_upstream error timeout http_500 http_502 http_503 http_504 http_404;
proxy_intercept_errors on;
proxy_pass http://myapp_old;
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment