4

There are many companies that load a web application for you on their servers like say wordpress etc., and since they have other customers on the same server I was curious how they do this w/o having to restart the web server?

If they do restart the web server, it would take down other client sites and that wouldn't be a good situation to be in.

Is it possible with nginx?

1
  • There isn't any need to restart your webserver if you upload new files (aka install new applications on it).
    – bjoster
    May 20, 2019 at 14:31

3 Answers 3

9
/etc/init.d/nginx reload

should reload your nginx config without restarting nginx or making current sites go down

that said, an nginx restart is normally a lot less than 30 seconds so I would be surprised if that was such a big problem

2

This isn't specific to nginx. You need to gracefully restart it, which means any new workers will use the new config while the running workers use the old config until they finish what they're doing and exit.

http://wiki.nginx.org/CommandLine

1

You can Load New Configuration Using Signals. It will

  1. Read and test a new configuration. If the configuration invalid then do nothing.
  2. When valid, start new processing workers with new configuration. Attach new workers to port listening, log, etc.
  3. Detach old workers from listeners.
  4. Gracefully shutdown old workers.

You can even Upgrade To a New Binary On The Fly. See the same doc.

To perform the reload, send the reload signal:

nginx -s reload

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.