user nginx nginx;
-error_log /var/log/nginx/nginx-@type@_error.log;
-pid /var/run/nginx-@type@.pid;
+error_log /var/log/nginx/error.log;
+pid /var/run/nginx.pid;
events {
worker_connections 2048;
log_format main '$remote_addr - $remote_user [$time_local] $request '
'"$status" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
- access_log /var/log/nginx/nginx-@type@_access.log main;
+ access_log /var/log/nginx/access.log main;
server {
listen 80;
#ssl_trusted_certificate /etc/nginx/ca.crt;
server_name localhost;
- access_log /var/log/nginx/nginx-@type@_access.log main;
+ access_log /var/log/nginx/access.log main;
location / {
autoindex on;
# chkconfig: 345 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
-# processname: nginx-@type@
-# pidfile: /var/run/nginx-@type@.pid
-# config: /etc/nginx/nginx-@type@.conf
+# processname: nginx
+# pidfile: /var/run/nginx.pid
+# config: /etc/nginx/nginx.conf
# Source function library
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
-nginx="/usr/sbin/nginx-@type@"
-svname="nginx (@type@)"
+nginx="/usr/sbin/nginx"
+svname="nginx"
prog=${nginx##*/}
sysconfig="/etc/sysconfig/$prog"
create 644 nginx nginx
sharedscripts
postrotate
- if [ -x /etc/rc.d/init.d/nginx-light ] ; then
- /sbin/service nginx-light reopen-logs > /dev/null
- fi
- if [ -x /etc/rc.d/init.d/nginx-standard ] ; then
- /sbin/service nginx-standard reopen-logs > /dev/null
- fi
- if [ -x /etc/rc.d/init.d/nginx-mail ] ; then
- /sbin/service nginx-mail reopen-logs > /dev/null
- fi
- if [ -x /etc/rc.d/init.d/nginx-perl ] ; then
- /sbin/service nginx-perl reopen-logs > /dev/null
- fi
+ /sbin/service nginx reopen-logs > /dev/null
endscript
}
-check process nginx-standard with pidfile /var/run/nginx-standard.pid
+check process nginx with pidfile /var/run/nginx.pid
group www
- start program = "/etc/rc.d/init.d/nginx-standard start"
- stop program = "/etc/rc.d/init.d/nginx-standard stop"
+ start program = "/etc/rc.d/init.d/nginx start"
+ stop program = "/etc/rc.d/init.d/nginx stop"
if failed url http://localhost/ timeout 10 seconds then restart
# if failed host 192.168.1.1 port 443 type TCPSSL
# certmd5 12-34-56-78-90-AB-CD-EF-12-34-56-78-90-AB-CD-EF
if 5 restarts within 5 cycles then timeout
# alert root@localhost
# alert 123456@sms on { timeout }
- depends on nginx-standard_bin
- depends on nginx-standard_rc
+ depends on nginx_bin
+ depends on nginx_rc
-check file nginx-standard_bin with path /usr/sbin/nginx-standard
+check file nginx_bin with path /usr/sbin/nginx
group nginx
if failed checksum then unmonitor
if failed permission 755 then unmonitor
if failed gid root then unmonitor
# alert root@localhost
-check file nginx-standard_rc with path /etc/rc.d/init.d/nginx-standard
+check file nginx_rc with path /etc/rc.d/init.d/nginx
group nginx
if failed checksum then unmonitor
if failed permission 754 then unmonitor
if failed gid root then unmonitor
# alert root@localhost
-check file nginx-stanard.conf path /etc/nginx/nginx-standard.conf
+check file nginx-stanard.conf path /etc/nginx/nginx.conf
if changed sha1 checksum
- then exec "/etc/init.d/nginx-standard graceful"
+ then exec "/etc/rc.d/init.d/nginx graceful"
[Service]
Type=forking
-PIDFile=/var/run/nginx-standard.pid
-ExecStartPre=/usr/sbin/nginx-standard -c /etc/nginx/nginx-standard.conf -t
-ExecStart=/usr/sbin/nginx-standard -c /etc/nginx/nginx-standard.conf
-ExecReload=/usr/sbin/nginx-standard -c /etc/nginx/nginx-standard.conf -s reload
-ExecStop=/usr/sbin/nginx-standard -c /etc/nginx/nginx-standard.conf -s stop
+PIDFile=/var/run/nginx.pid
+ExecStartPre=/usr/sbin/nginx -c /etc/nginx/nginx.conf -t
+ExecStart=/usr/sbin/nginx -c /etc/nginx/nginx.conf
+ExecReload=/usr/sbin/nginx -c /etc/nginx/nginx.conf -s reload
+ExecStop=/usr/sbin/nginx -c /etc/nginx/nginx.conf -s stop
[Install]
WantedBy=multi-user.target