My nginx.conf has two different server blocks, one pointing to the main site and the other to my api server. Now whenever I deploy something to either one of them, and stop the server it stops both these servers. Is there a way to stop/restart one particular server without disturbing the other one?
=============
EDIT:
I've been doing it wrong. I should not be restarting nginx. In my case all I wanted was Passenger to recogonize my code changes and refresh. Simply creating a tmp/restart.txt
file inside the Rails.root
directory did the trick for me.
For anyone facing the same issue, create an empty file tmp/restart.txt
in your root path and every time that you want to deploly simply touch it.
touch tmp/restart.txt
For more details, check https://stackoverflow.com/questions/4480078/how-to-make-nginx-be-aware-of-rails-code-changes
Best Answer
No, there is no option to restart individual virtual server instances. However, there shouldn't even be any need to do that when app server is upgraded.