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.
| Itema | Value | Description |
| HAVESSL | 0, 1 | For ssl and non-SSL template blocks |
| HAVE_DEDICATED_IP | 0, 1 | For a dedicated IP |
| TYPE | main, sub, park, addon | Type of the domain |
| DOMAIN | Website | The domain name |
| DOCROOT | Path | The document root of the domain |
| IP | Ip address | IP address of the domain |
| USER | The cPanel user | The cPanel username of the domain owner |
| APACHE_HTTP_PORT | 9080 | The HTTP port of Apache, or Lightspeed |
| APACHE_HTTPS_PORT | 9443 | The ssl port of Apache, or LightSpeed |
| PARENT_DOMAIN | The associated domain | Using for parked domains |
| STATIC_FILES | Extensions | Static file extension serving from nginx |
| WWW_REDIRECTION | 0, 1 | Slow-loris DDoS protection |
| SYMLINK_ATTACK | on, off | Symlink protection |
| DIRECTORY_LIST | 1, 0 | Enable or disable directory listing |
| MOD_FLV | 1,0 | Enable or disable FLV streaming |
| MOD_MP4 | 1,0 | Enable or disable MP4 streaming |
| MAX_BODY_SIZE | 2000m | Nginx variable |
| BODY_BUFFER_SIZE | 512k | Nginx variable |
| USERDIR_STATUS | 1,0 | Enable or disable the nginx userdir |
| DIRECTORY_LIST | 1,0 | Enable or disable the nginx directory list |
| HOT_LINK_PROTECTION | 1,0 | Enable or disable Hotlink protection |
| PROXY_BUFFERING | on, off | Nginx variable |
| PROXY_SEND_TIMEOUT | 300s | Nginx variable |
| PROXY_READ_TIMEOUT | 300s | Nginx variable |
| PROXY_BUFFER_SIZE | 64k | Nginx variable |
| PROXY_BUFFERS | 32 64k | Nginx variable |
| PROXY_BUSY_BUFFERS_SIZE | 128k | Nginx variable |
| PROXY_TEMP_FILE_WRITE_SIZE | 128k | Nginx variable |
| PROXY_CONNECT_TIMEOUT | 300s | Nginx variable |
| PROXY_HTTP_VERSION | 1.1,1.0 | Nginx variable |
| PROXY_SET_HEADER_CONNECTION | 0,1 | Set the proxy header Connection |
| PROXY_CACHE | 1,0 | Enable or disable proxy cache |
| PROXY_CACHE_REVALIDATE | On, off | Nginx variable |
| PROXY_CACHE_MIN_USES | 5 | Nginx variable |
| PROXY_CACHE_LOCK | on, off | Nginx variable |
| PROXY_CACHE_VALID | 60h | Nginx variable |
| PROXY_CACHE_USE_STALE | 0,1 | Nginx variable |
| FASTCGI_CACHE | 1,0 | Enable or disable php-fpm fcgi cache |
| FASTCGI_CACHE_REVALIDATE | 0,1 | Nginx variable |
| FASTCGI_CACHE_VALID | 30m | Nginx variable |
| FASTCGI_CACHE_MIN_USES | 3 | Nginx variable |
| FASTCGI_CACHE_LOCK | 1,0 | Nginx variable |
| FASTCGI_CACHE_USE_STALE | 1,0 | Nginx variable |
| SSL_PROTOCOLS | TLSv1.2 TLSv1.3 | Allowed ssl protocols |
| HTTP2 | 1,0 | Enable or disable http2 |
| HTTP3 | 1,0 | Enable or disable HTTP3 |
| HTTPS_REDIRECTION | 1,0 | Enable or disable HTTP to HTTPS redirection |
| LIMIT_CONN | 1,0 | Enable or disable nginx limit_conn |
| LIMIT_CONN_PERCLIENTIP | 10 | Limit connections per IP |
| LIMIT_CONN_PERVIRTUALSERVER | 100 | Limit connection to vhost |
| REQ_MODULE | 1,0 | Enable or disable the nginx req module |
| LIMIT_REQ_PERCLIENTIP | 10 | Limit requests per IP |
| LIMIT_REQ_PERVIRTUALSERVER | 100 | Limit requests per vhost |
| CLIENT_HEADER_TIMEOUT | 5s | Nginx variable |
| CLIENT_BODY_TIMEOUT | 180s | Nginx variable |
| RANGE_PROTECTION | 1,0 | Enable or disable range-based attacks |
| HTTP_METHOD_ENABLE | 1,0 | Enable or disable HTTP methods (HEAD, GET, POST) |
| USER_AGENT_ATTACK_PROTECTION | 1,0 | Enable or disable user agent attack protection |
| SCANNER_ATTACK_PROTECTION | 1,0 | Enable or disable scanner attacks |
| XSS_PROTECTION | 1,0 | Enable or disable XSS attacks |
| XFRAME_ATTACK_PROTECTION | 1,0 | Enable or disable X-Frame attacks |
| PROTECT_SQL_INJECTION | 1,0 | Enable or disable SQL injection attacks |
| PROTECT_FILE_INJECT | 1,0 | Enable or disable file injection |
| PROTECT_COMMON_EXPLOITS | 1,0 | Enable or disable common exploit attacks |
| REFERRER_SPAM_PROTECTION | 1,0 | Enable or disable referrer spam |
| KEEPALIVE_REQUEST | 100 | Nginx variable |
| KEEPALIVE_TIMEOUT | 60s | Nginx variable |