Skip to content

Instantly share code, notes, and snippets.

@mingshun
Created June 21, 2014 07:25
Show Gist options
  • Save mingshun/713fef40577654b70db7 to your computer and use it in GitHub Desktop.
Save mingshun/713fef40577654b70db7 to your computer and use it in GitHub Desktop.
upgrade nginx without downtime
kill -USR2 [old master process]
kill -WINCH [old master process]
# After all old workers quit, shut down the old master process if it is unused any more.
kill -TERM [old master process]
# Revert to the old nginx while the old master was not shutted down.
kill -HUP [old master process]
kill -QUIT [new master process]
kill -TERM [new master process]
# If there is anything wrong while shutting down the new workers, just kill them.
kill -KILL [new worker process]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment