Blob Blame History Raw
[Unit]
Description=The nginx HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target

[Service]
Type=forking
PIDFile=$localstatedir/run/nginx/nginx.pid
EnvironmentFile=/opt/rh/rh-nginx$scl_name_version/service-environment
# Nginx will fail to start if /run/nginx.pid already exists but has the wrong
# SELinux context. This might happen when running `nginx -t` from the cmdline.
# https://bugzilla.redhat.com/show_bug.cgi?id=1268621
ExecStartPre=/usr/bin/rm -f /var/opt/rh/rh-nginx$scl_name_version/run/nginx/nginx.pid
ExecStartPre=$libexecdir/nginx-scl-helper enable $RH_NGINX$scl_name_version_SCLS_ENABLED -- /usr/bin/scl_enabled rh-nginx$scl_name_version
ExecStartPre=$libexecdir/nginx-scl-helper enable $RH_NGINX$scl_name_version_SCLS_ENABLED -- /opt/rh/rh-nginx$scl_name_version/root/usr/sbin/nginx -t
ExecStart=$libexecdir/nginx-scl-helper enable $RH_NGINX$scl_name_version_SCLS_ENABLED -- /opt/rh/rh-nginx$scl_name_version/root/usr/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
KillSignal=SIGQUIT
TimeoutStopSec=5
KillMode=process
PrivateTmp=true

[Install]
WantedBy=multi-user.target