Skip to main content

Template Variables

The template variables that can be used inside the vhosts templates

Cpnginx passes the template variables as a dictionary to the specific template files. Each template must contain an SSL and a NON-SSL part. The following are the template variables.

ItemaValueDescription
HAVESSL0, 1For ssl and non-SSL template blocks
HAVE_DEDICATED_IP0, 1For a dedicated IP
TYPEmain, sub, park, addonType of the domain
DOMAINWebsiteThe domain name
DOCROOTPathThe document root of the domain
IPIp addressIP address of the domain
USERThe cPanel userThe cPanel username of the domain owner
APACHE_HTTP_PORT9080The HTTP port of Apache, or Lightspeed
APACHE_HTTPS_PORT9443The ssl port of Apache, or LightSpeed
PARENT_DOMAINThe associated domainUsing for parked domains
STATIC_FILESExtensionsStatic file extension serving from nginx
WWW_REDIRECTION0, 1Slow-loris DDoS protection
SYMLINK_ATTACKon, offSymlink protection
DIRECTORY_LIST1, 0Enable or disable directory listing
MOD_FLV1,0Enable or disable FLV streaming
MOD_MP41,0Enable or disable MP4 streaming
MAX_BODY_SIZE2000mNginx variable
BODY_BUFFER_SIZE512kNginx variable
USERDIR_STATUS1,0Enable or disable the nginx userdir
DIRECTORY_LIST1,0Enable or disable the nginx directory list
HOT_LINK_PROTECTION1,0Enable or disable Hotlink protection
PROXY_BUFFERINGon, offNginx variable
PROXY_SEND_TIMEOUT300sNginx variable
PROXY_READ_TIMEOUT300sNginx variable
PROXY_BUFFER_SIZE64kNginx variable
PROXY_BUFFERS32 64kNginx variable
PROXY_BUSY_BUFFERS_SIZE128kNginx variable
PROXY_TEMP_FILE_WRITE_SIZE128kNginx variable
PROXY_CONNECT_TIMEOUT300sNginx variable
PROXY_HTTP_VERSION1.1,1.0Nginx variable
PROXY_SET_HEADER_CONNECTION0,1Set the proxy header Connection
PROXY_CACHE1,0Enable or disable proxy cache
PROXY_CACHE_REVALIDATEOn, offNginx variable
PROXY_CACHE_MIN_USES5Nginx variable
PROXY_CACHE_LOCKon, offNginx variable
PROXY_CACHE_VALID60hNginx variable
PROXY_CACHE_USE_STALE0,1Nginx variable
FASTCGI_CACHE1,0Enable or disable php-fpm fcgi cache
FASTCGI_CACHE_REVALIDATE0,1Nginx variable
FASTCGI_CACHE_VALID30mNginx variable
FASTCGI_CACHE_MIN_USES3Nginx variable
FASTCGI_CACHE_LOCK1,0Nginx variable
FASTCGI_CACHE_USE_STALE1,0Nginx variable
SSL_PROTOCOLSTLSv1.2 TLSv1.3Allowed ssl protocols
HTTP21,0Enable or disable http2
HTTP31,0Enable or disable HTTP3
HTTPS_REDIRECTION1,0Enable or disable HTTP to HTTPS redirection
LIMIT_CONN1,0Enable or disable nginx limit_conn
LIMIT_CONN_PERCLIENTIP10Limit connections per IP
LIMIT_CONN_PERVIRTUALSERVER100Limit connection to vhost
REQ_MODULE1,0Enable or disable the nginx req module
LIMIT_REQ_PERCLIENTIP10Limit requests per IP
LIMIT_REQ_PERVIRTUALSERVER100Limit requests per vhost