'\" t
.\"     Title: ocf_heartbeat_nginx
.\"    Author: ClusterLabs contributors (see the resource agent source for information about individual authors)
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
.\"      Date: 03/20/2024
.\"    Manual: OCF resource agents
.\"    Source: resource-agents UNKNOWN
.\"  Language: English
.\"
.TH "OCF_HEARTBEAT_NGINX" "7" "03/20/2024" "resource-agents UNKNOWN" "OCF resource agents"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
ocf_heartbeat_nginx \- Manages an Nginx web/proxy server instance
.SH "SYNOPSIS"
.HP \w'\fBnginx\fR\ 'u
\fBnginx\fR [start | stop | status | monitor | meta\-data | validate\-all]
.SH "DESCRIPTION"
.PP
This is the resource agent for the Nginx web/proxy server\&. This resource agent does not monitor POP or IMAP servers, as we don\*(Aqt know how to determine meaningful status for them\&.
.PP
The start operation ends with a loop in which monitor is repeatedly called to make sure that the server started and that it is operational\&. Hence, if the monitor operation does not succeed within the start operation timeout, the nginx resource will end with an error status\&.
.PP
The default monitor operation will verify that nginx is running\&.
.PP
The level 10 monitor operation by default will try and fetch the /nginx_status page \- which is commented out in sample nginx configurations\&. Make sure that the /nginx_status page works and that the access is restricted to localhost (address 127\&.0\&.0\&.1) plus whatever places _outside the cluster_ you want to monitor the server from\&. See the status10url and status10regex attributes for more details\&.
.PP
The level 20 monitor operation will perform a more complex set of tests from a configuration file\&.
.PP
The level 30 monitor operation will run an external command to perform an arbitrary monitoring operation\&.
.PP
.SH "SUPPORTED PARAMETERS"
.PP
\fBconfigfile\fR
.RS 4
The full pathname of the Nginx configuration file\&. This file is parsed to provide defaults for various other resource agent parameters\&.
.sp
(unique, optional, string, no default)
.RE
.PP
\fBhttpd\fR
.RS 4
The full pathname of the httpd binary (optional)\&.
.sp
(optional, string, default "/usr/sbin/httpd")
.RE
.PP
\fBport\fR
.RS 4
A port number that we can probe for status information using the statusurl\&. This will default to the port number found in the configuration file, or 80, if none can be found in the configuration file\&.
.sp
(optional, integer, no default)
.RE
.PP
\fBstatus10url\fR
.RS 4
The URL to monitor (the nginx server status page by default) when given a level 10 monitor operation\&. If left unspecified, it will be inferred from the nginx configuration file, or defaulted to /nginx_status\&.
.sp
If you set this, make sure that it succeeds *only* from the localhost (127\&.0\&.0\&.1) and no other cluster nodes\&. Otherwise, the cluster software may complain about it being active on multiple nodes\&.
.sp
(optional, string, no default)
.RE
.PP
\fBstatus10regex\fR
.RS 4
Regular expression to match in the output of status10url\&. Case insensitive\&.
.sp
(optional, string, default "Reading: [0\-9]+ Writing: [0\-9]+ Waiting: [0\-9]+")
.RE
.PP
\fBtestclient\fR
.RS 4
Client to use to query to Nginx for level 10 and level 20 tests\&. If not specified, the RA will try to find one on the system\&. Currently, wget and curl are supported, with curl being preferred\&. For example, you can set this parameter to "wget" if you prefer that to curl\&.
.sp
(optional, string, no default)
.RE
.PP
\fBtest20url\fR
.RS 4
URL to test\&. If it does not start with "http", then it\*(Aqs considered to be relative to the document root address\&.
.sp
(optional, string, no default)
.RE
.PP
\fBtest20regex\fR
.RS 4
Regular expression to match in the output of test20url\&. Case insensitive\&.
.sp
(optional, string, no default)
.RE
.PP
\fBtest20conffile\fR
.RS 4
A file which contains a more complex test configuration\&. Could be useful if you have to check more than one web application or in case sensitive info should be passed as arguments (passwords)\&. Furthermore, using a config file is the only way to specify certain parameters\&.
.sp
Please see README\&.webapps for examples and file description\&.
.sp
(optional, string, no default)
.RE
.PP
\fBtest20name\fR
.RS 4
Name of the test within the test configuration file\&.
.sp
(optional, string, no default)
.RE
.PP
\fBexternal_monitor30_cmd\fR
.RS 4
Command string to run which implements level 30 monitoring\&.
.sp
(optional, string, no default)
.RE
.PP
\fBoptions\fR
.RS 4
Extra options to apply when starting nginx\&.
.sp
(optional, string, no default)
.RE
.SH "SUPPORTED ACTIONS"
.PP
This resource agent supports the following actions (operations):
.PP
\fBstart\fR
.RS 4
Starts the resource\&. Suggested minimum timeout: 40s\&.
.RE
.PP
\fBstop\fR
.RS 4
Stops the resource\&. Suggested minimum timeout: 60s\&.
.RE
.PP
\fBreload\fR
.RS 4
Suggested minimum timeout: 40s\&.
.RE
.PP
\fBstatus\fR
.RS 4
Performs a status check\&. Suggested minimum timeout: 30s\&.
.RE
.PP
\fBmonitor\fR
.RS 4
Performs a detailed status check\&. Suggested minimum timeout: 30s\&. Suggested interval: 10s\&.
.RE
.PP
\fBmonitor\fR
.RS 4
Performs a detailed status check\&. Suggested minimum timeout: 30s\&. Suggested interval: 30s\&.
.RE
.PP
\fBmonitor\fR
.RS 4
Performs a detailed status check\&. Suggested minimum timeout: 45s\&.
.RE
.PP
\fBmonitor\fR
.RS 4
Performs a detailed status check\&. Suggested minimum timeout: 60s\&.
.RE
.PP
\fBmeta\-data\fR
.RS 4
Retrieves resource agent metadata (internal use only)\&. Suggested minimum timeout: 5s\&.
.RE
.PP
\fBvalidate\-all\fR
.RS 4
Performs a validation of the resource configuration\&. Suggested minimum timeout: 5s\&.
.RE
.SH "EXAMPLE CRM SHELL"
.PP
The following is an example configuration for a nginx resource using the
\fBcrm\fR(8)
shell:
.sp
.if n \{\
.RS 4
.\}
.nf
primitive p_nginx ocf:heartbeat:nginx \e
  op monitor timeout="30s" depth="0" interval="10s" \e
  op monitor timeout="30s" depth="10" interval="30s" \e
  op monitor timeout="45s" depth="20" \e
  op monitor timeout="60s" depth="30" 
.fi
.if n \{\
.RE
.\}
.SH "EXAMPLE PCS"
.PP
The following is an example configuration for a nginx resource using
\fBpcs\fR(8)
.sp
.if n \{\
.RS 4
.\}
.nf
pcs resource create p_nginx ocf:heartbeat:nginx \e
  op monitor timeout="30s" depth="0" interval="10s" \e
  op monitor timeout="30s" depth="10" interval="30s" \e
  op monitor timeout="45s" depth="20" \e
  op monitor timeout="60s" depth="30" 
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.PP
\m[blue]\fB\%http://clusterlabs.org/\fR\m[]
.SH "AUTHOR"
.PP
\fBClusterLabs contributors (see the resource agent source for information about individual authors)\fR
