gem version

Creating an Nginx init script

Relevant selection for this article:


If you installed Nginx with one of the generic installation methods (source tarball or RubyGems then you won't have an init script to start, stop and restart Nginx with.

A bare Nginx installation works with signals: you start it by invoking it from the command line, you stop it by sending SIGTERM to it and you gracefully restart it by sending SIGHUP to it. This is described in the section "Using Nginx" in one of the installation guides.

If you prefer to use an init script then please refer to the following resources:

When using one of those init scripts, please make sure that the paths inside the init script are correct. In particular, the paths to the Nginx binary, to the PID file and to the configuration file must match the actual locations of your Nginx installation.

light mode dark mode
Passenger 6 Passenger 6