SlickStack is designed to work behind Cloudflare for public DNS, reverse-proxy traffic, edge security, and HTTPS between visitors and the origin server.
SlickStack manages the origin-side Nginx configuration. It does not create Cloudflare zones, DNS records, SSL/TLS dashboard settings, WAF rules, cache rules, redirects, or account credentials.
- Recommended baseline
- SlickStack settings
- DNS and proxy setup
- SSL/TLS encryption mode
- Restoring visitor IP addresses
- Cloudflare-only origin access
- Authenticated Origin Pulls
- Cloudflare credentials and Certbot DNS validation
- Cloudflare IP range refreshes
- Nginx, Cloudflare, and request limits
- Caching boundaries
- Interaction with other SlickStack components
- Managed files
- Verification
- Troubleshooting
- Scope
- References
A normal SlickStack deployment should begin with:
CLOUDFLARE_REAL_IPS="true"
CLOUDFLARE_IPS_ONLY="false"
CLOUDFLARE_AUTHENTICATED_ORIGIN="false"Then:
- point the required Cloudflare DNS records to the SlickStack origin
- enable Cloudflare proxying for the public website records
- use Cloudflare Full mode with SlickStack's default self-signed OpenSSL certificate
- use Full (strict) after activating a valid Certbot, Cloudflare Origin CA, or suitable third-party certificate
- verify the site, logs, SSL, WordPress, and Certbot behavior
- enable stricter origin protections only after the basic proxy setup is stable
Do not begin by enabling every restriction at once. Real-IP restoration, Cloudflare-only origin access, Authenticated Origin Pulls, and certificate validation solve different problems and fail differently.
Current limitation: Do not enable
CLOUDFLARE_IPS_ONLY="true"together withCLOUDFLARE_REAL_IPS="true". Nginx replaces the client address withCF-Connecting-IPbefore itsallowanddenyaccess checks run. The current SlickStackallowed-ips.confthen compares Cloudflare's network allowlist against the restored visitor address and can reject legitimate proxied traffic. TreatCLOUDFLARE_IPS_ONLYas experimental until the implementation is changed to evaluate the original network peer address.
The Cloudflare-related ss-config values are:
CLOUDFLARE_EMAIL=""
CLOUDFLARE_API_KEY=""
CLOUDFLARE_IPS_ONLY="false"
CLOUDFLARE_AUTHENTICATED_ORIGIN="false"
CLOUDFLARE_REAL_IPS="true"| Setting | Default | Purpose |
|---|---|---|
CLOUDFLARE_REAL_IPS |
true |
Trust Cloudflare proxy ranges and restore the visitor address from CF-Connecting-IP |
CLOUDFLARE_IPS_ONLY |
false |
Installs a Cloudflare network allowlist, but currently conflicts with real-IP restoration |
CLOUDFLARE_AUTHENTICATED_ORIGIN |
false |
Validate Cloudflare's client certificate for the origin gate used by the standard production server block |
CLOUDFLARE_EMAIL |
empty | Cloudflare account email used by the current Certbot DNS credentials format |
CLOUDFLARE_API_KEY |
empty | Cloudflare Global API Key used by the current Certbot DNS credentials format |
After changing these values, rebuild the managed Nginx configuration:
sudo bash /var/www/ss-install-nginx-configThe complete installer also reapplies the configuration:
sudo bash /var/www/ss-installCloudflare DNS remains an administrator responsibility.
At minimum, the hostname represented by:
SITE_FULL_DOMAIN="example.com"must resolve to the intended SlickStack origin. Depending on the selected canonical domain and enabled environments, additional records can include:
example.com
www.example.com
staging.example.com
dev.example.com
Use proxied records—the orange cloud—for hostnames that should receive Cloudflare caching, WAF, DDoS, TLS, and origin-protection benefits.
DNS-only records connect visitors directly to the origin and can expose its address. They also bypass Cloudflare's WAF and other edge controls.
SlickStack does not automatically:
- create or update A, AAAA, or CNAME records
- enable proxying
- remove obsolete DNS records
- hide origin addresses exposed by unrelated DNS records
- manage Cloudflare nameservers
- validate that staging and development records exist
Confirm DNS before enabling stricter origin controls:
dig +short example.com
dig +short www.example.comA proxied record normally returns Cloudflare edge addresses rather than the origin address.
Cloudflare's SSL/TLS mode controls the connection from Cloudflare to the SlickStack origin.
| SlickStack certificate | Recommended Cloudflare mode |
|---|---|
| Self-signed OpenSSL | Full |
| Certbot / Let's Encrypt | Full (strict) |
| Valid publicly trusted third-party certificate | Full (strict) |
| Cloudflare Origin CA installed as a third-party certificate | Full (strict) |
The default SlickStack OpenSSL certificate is self-signed. Cloudflare Full mode encrypts traffic to the origin without requiring a publicly trusted certificate.
This is the expected starting mode for a new SlickStack server using:
SSL_TYPE="openssl"Full (strict) validates the origin certificate. Use it after SlickStack is actively presenting a valid certificate matching the requested hostname.
For Certbot:
SSL_TYPE="certbot"Then run:
sudo bash /var/www/ss-install-nginx-configSee SSL Certificates for certificate issuance, activation, paths, and fallback behavior.
Cloudflare Flexible mode is not supported for SlickStack. Flexible sends plaintext HTTP from Cloudflare to the origin, while SlickStack is HTTPS-only and redirects HTTP requests to HTTPS. That combination can create redirect loops and removes encryption between Cloudflare and the origin.
Cloudflare Off mode is also incompatible with SlickStack's HTTPS-only design.
Use Full or Full (strict).
When Cloudflare proxies a request, the network connection reaching Nginx normally comes from a Cloudflare address rather than the visitor's address.
With:
CLOUDFLARE_REAL_IPS="true"SlickStack downloads Cloudflare's current IPv4 and IPv6 ranges and generates:
/var/www/sites/includes/cloudflare.conf
The generated file contains one trusted proxy directive per Cloudflare network:
set_real_ip_from 192.0.2.0/24;and activates:
real_ip_header CF-Connecting-IP;The live Nginx configuration includes this file in the global http context.
After Nginx processes a trusted Cloudflare request, $remote_addr represents the visitor address. The original network peer remains available to Nginx as $realip_remote_addr.
Real-IP restoration affects:
/var/www/logs/nginx-access.log- Nginx per-IP request and connection limits
- WordPress and PHP applications reading the remote address
- Adminer rate limiting
- the current Fail2ban Nginx filters
- any Nginx access rules that evaluate the client address
Without real-IP restoration, many visitors can appear to come from the same Cloudflare proxy address. That can make logs less useful and cause per-IP security controls to group unrelated users together.
SlickStack trusts CF-Connecting-IP only from addresses listed in the generated Cloudflare configuration. A direct visitor should not be able to spoof the header merely by sending it to the origin from an untrusted address.
The trusted range list must therefore remain current.
Check the generated configuration:
grep -c "set_real_ip_from" /var/www/sites/includes/cloudflare.conf
grep "real_ip_header" /var/www/sites/includes/cloudflare.conf
sudo nginx -tThen inspect requests:
tail -n 50 /var/www/logs/nginx-access.logThe first address should normally be the visitor address rather than a Cloudflare proxy address.
When CLOUDFLARE_REAL_IPS="false", the full Nginx installer removes the managed Cloudflare real-IP include.
SlickStack currently exposes this setting:
CLOUDFLARE_IPS_ONLY="true"It generates:
/var/www/sites/includes/allowed-ips.conf
The file contains Cloudflare's IPv4 and IPv6 ranges as Nginx allow directives followed by:
deny all;The file is included in Nginx's global http context.
The current implementation does not safely combine with the default:
CLOUDFLARE_REAL_IPS="true"Nginx's real-IP module changes the client address before access-module rules evaluate it. Therefore the allow directives in allowed-ips.conf see the restored visitor address rather than the Cloudflare proxy address.
A normal visitor address does not match Cloudflare's network ranges, so the final deny all can reject the request even though it arrived through Cloudflare.
The original proxy address is available through $realip_remote_addr, but the current allow and deny template does not use that variable.
Leave:
CLOUDFLARE_IPS_ONLY="false"on normal production servers.
Do not use this setting as the primary origin-protection control until SlickStack changes the implementation to evaluate the original peer address through a compatible geo, map, network-firewall, or equivalent design.
Setting CLOUDFLARE_REAL_IPS="false" avoids the direct conflict because $remote_addr remains the Cloudflare proxy address, but then access logs and per-IP Nginx limits no longer operate on the real visitor address. That tradeoff is usually worse than leaving CLOUDFLARE_IPS_ONLY disabled.
The intended purpose is to prevent direct web requests from bypassing Cloudflare and reaching the origin through Nginx.
Even after the implementation is corrected, an Nginx Cloudflare allowlist would not:
- change Iptables rules
- close ports 80 or 443 at the network layer
- restrict SSH or SFTP
- protect MySQL, Memcached, or PHP-FPM directly
- hide an origin address that has already been exposed
- prove that the request belongs to your specific Cloudflare account
Network-layer Cloudflare allowlisting belongs in Iptables or the cloud provider firewall, where the original TCP peer address is still available.
Authenticated Origin Pulls uses mutual TLS between Cloudflare and the origin. Cloudflare presents a client certificate, and the origin evaluates that certificate before serving the request.
Enable the origin-side SlickStack configuration with:
CLOUDFLARE_AUTHENTICATED_ORIGIN="true"The installer downloads Cloudflare's shared client-certificate authority and manages:
/var/www/certs/cloudflare.pem
/var/www/sites/includes/auth-origin.conf
/var/www/sites/includes/origin-gate.conf
The Nginx configuration:
- requests a client certificate without failing the TLS handshake immediately
- allows loopback addresses in the authentication map
- accepts successfully verified Cloudflare client certificates
- sets an internal allow/deny variable
- returns
403through the origin gate when neither condition is satisfied
The Cloudflare zone must also have Authenticated Origin Pulls enabled. Setting only the SlickStack value does not make Cloudflare present the required client certificate.
The safest order is:
- confirm proxied HTTPS works in Full or Full (strict) mode
- enable Authenticated Origin Pulls for the Cloudflare zone
- set
CLOUDFLARE_AUTHENTICATED_ORIGIN="true" - run
ss-install-nginx-config - test the public proxied site immediately
Cloudflare presenting a client certificate to an origin that does not yet validate it is normally harmless. Enabling the origin gate first can cause public requests to receive 403 until Cloudflare begins presenting the certificate.
SlickStack downloads Cloudflare's shared global Authenticated Origin Pull certificate. This verifies that the connection came from the Cloudflare network; it does not prove that the request came from only your Cloudflare account.
Cloudflare zone-level and per-hostname Authenticated Origin Pull certificates use account-specific certificates. SlickStack does not currently generate, upload, or manage those custom AOP certificates.
The current standard single-site production server block includes:
include /var/www/sites/includes/origin-gate[.]conf;The current staging, development, and Multisite server-block templates do not include the same origin gate.
Therefore CLOUDFLARE_AUTHENTICATED_ORIGIN="true" should not be described as universal enforcement across every SlickStack hostname or server-block mode.
Normal Cloudflare proxying and real-IP restoration do not require Cloudflare API credentials.
The credentials are used by SlickStack's Certbot DNS workflow for WordPress Multisite wildcard certificates.
The current implementation expects:
CLOUDFLARE_EMAIL="account@example.com"
CLOUDFLARE_API_KEY="global-api-key"When both values exist, ss-encrypt-certbot generates:
/var/www/meta/cloudflare.ini
with:
dns_cloudflare_email = account@example.com
dns_cloudflare_api_key = global-api-keyThe file is owned by root:root and uses mode 0600.
Certbot receives it through:
--dns-cloudflare-credentials /var/www/meta/cloudflare.ini
--dns-cloudflare-propagation-seconds 30
The sample ss-config comment mentions an API key or token, but the active generation script always writes the Global API Key fields shown above.
Cloudflare API tokens require the separate Certbot field:
dns_cloudflare_api_token = token-valueSlickStack does not currently generate that format. Use the Global API Key for the current managed wildcard workflow, or treat a manual token-based credentials file as unsupported because a later SlickStack run can overwrite it.
Never publish /var/www/meta/cloudflare.ini, include it in public backups, or paste its contents into support tickets.
See SSL Certificates for the complete Certbot workflow.
The full Nginx configuration installer downloads Cloudflare's current IPv4 and IPv6 lists whenever it rebuilds the Cloudflare-related includes:
sudo bash /var/www/ss-install-nginx-configThe sample configuration also retains:
INTERVAL_SS_INSTALL_NGINX_CLOUDFLARE_IPS="half-weekly"and the half-weekly, weekly, and half-monthly cron wrappers still reference a standalone Cloudflare IP refresh task.
However, the current standalone script remains under bash/archive/, and current ss-functions does not define an active PATH_SS_INSTALL_NGINX_CLOUDFLARE_IPS path alongside the normal installer paths.
Do not rely exclusively on the legacy scheduled standalone refresh. The authoritative current workflow is:
sudo bash /var/www/ss-install-nginx-configThis rebuilds both Cloudflare range files and validates that the downloaded templates contain the expected directives before replacing the installed files.
SlickStack's Nginx request limits use variables based on the remote address, including:
$binary_remote_addrWith real-IP restoration enabled, per-IP Nginx limits apply to the visitor address. Without it, limits can apply to Cloudflare proxy addresses and unintentionally combine many visitors into shared buckets.
Cloudflare also has independent WAF, rate-limiting, bot, and DDoS controls at its edge. SlickStack does not create or synchronize those rules.
A sensible division is:
- Cloudflare handles broad edge filtering and DDoS absorption
- Nginx handles origin-level request and connection limits
- Iptables handles the persistent server firewall
- WordPress handles application permissions and authentication
Do not assume one layer replaces every other layer.
Cloudflare edge caching and SlickStack FastCGI caching are separate systems.
SlickStack manages the Nginx FastCGI cache but does not create Cloudflare Cache Rules or automatically purge Cloudflare's edge cache.
When creating Cloudflare rules, avoid caching sensitive or user-specific paths such as:
/wp-admin/
/wp-login.php
/adminer
cart
checkout
account pages
WordPress plugins that purge Cloudflare through its API are outside the standard SlickStack configuration and require their own credentials and security review.
CLOUDFLARE_REAL_IPS determines whether access logs normally show visitor addresses or Cloudflare proxy addresses.
Real-IP restoration is important because SlickStack's rate zones are keyed by the remote address.
The current Fail2ban Nginx filters assume the first address in the Nginx access log is the visitor address. Incorrect real-IP handling can cause Cloudflare proxy addresses to be evaluated or banned instead.
Fail2ban is planned for removal from SlickStack, but this interaction matters while it remains installed. See Fail2ban.
Adminer's Nginx rate limit also uses the remote address. Cloudflare proxying does not replace Adminer authentication, and a randomized URL does not make public database administration risk-free. See Adminer.
Single-site certificates normally use HTTP webroot validation. Multisite wildcard certificates use Cloudflare DNS validation and require the managed credentials file.
Incorrect records, strict origin controls, or missing credentials can prevent issuance.
Iptables sees the original network peer address, which is normally a Cloudflare proxy when traffic is proxied. Nginx real-IP restoration happens later at the HTTP layer and does not rewrite the source address seen by Iptables.
That makes Iptables or the provider firewall a better layer for a future Cloudflare network allowlist. See Iptables.
Cloudflare-related managed files can include:
/var/www/sites/includes/cloudflare.conf
/var/www/sites/includes/allowed-ips.conf
/var/www/sites/includes/auth-origin.conf
/var/www/sites/includes/origin-gate.conf
/var/www/certs/cloudflare.pem
/var/www/meta/cloudflare.ini
Direct edits can be replaced by ss-install-nginx-config, ss-encrypt-certbot, permission resets, or the complete installer.
Persistent behavior should be controlled through supported ss-config values. Current unsupported gaps should be fixed in the SlickStack source rather than patched only on one server.
Useful checks include:
sudo nginx -t
systemctl status nginx
grep '^CLOUDFLARE_' /var/www/ss-config
grep -c 'set_real_ip_from' /var/www/sites/includes/cloudflare.conf
grep -c '^allow ' /var/www/sites/includes/allowed-ips.conf
grep 'ssl_verify_client' /var/www/sites/includes/auth-origin.conf
ls -l /var/www/certs/cloudflare.pem
ls -l /var/www/meta/cloudflare.ini
tail -n 100 /var/www/logs/nginx-error.log
tail -n 50 /var/www/logs/nginx-access.logCheck the public route:
curl -I https://example.comWhen strict origin restrictions are enabled, a direct origin test can fail even while the public Cloudflare route works.
Confirm Cloudflare is not using Flexible mode. SlickStack redirects HTTP to HTTPS and expects Cloudflare to connect to the origin over HTTPS.
Use Full with the self-signed OpenSSL certificate or Full (strict) with a valid origin certificate.
Cloudflare reached the origin network but the web server refused the connection.
Check:
systemctl status nginx
ss -lntp | grep -E ':80|:443'
tail -n 100 /var/www/logs/nginx-error.logAlso confirm Cloudflare ranges are not being rejected by stale Nginx, Iptables, provider-firewall, or external-security rules.
Cloudflare timed out connecting to the origin.
Check:
- the Cloudflare DNS record points to the current origin address
- the cloud provider firewall allows ports 80 and 443
- Nginx and the server are responsive
- current Cloudflare ranges are not blocked or rate-limited
- the server is not overloaded
The TLS handshake between Cloudflare and Nginx failed.
Check:
sudo nginx -t
openssl s_client -connect 127.0.0.1:443 -servername example.comVerify Nginx is listening on port 443 and has a usable certificate, key, protocol, and cipher configuration.
Full (strict) could not validate the certificate presented by the origin.
Confirm:
- the certificate is unexpired
- the hostname is included
- the chain is complete
SSL_TYPEactivates the intended certificate/var/www/certs/fullchain.pemand its private-key symlink resolve correctly for Certbot
Use Full temporarily with SlickStack's self-signed certificate, or install and activate a certificate suitable for Full (strict).
Disable the current setting:
CLOUDFLARE_IPS_ONLY="false"Then run:
sudo bash /var/www/ss-install-nginx-configWhen CLOUDFLARE_REAL_IPS="true", the current Nginx access allowlist evaluates the restored visitor address and can reject legitimate Cloudflare traffic.
Confirm Authenticated Origin Pulls is enabled in the Cloudflare dashboard and that the standard production server block includes the origin gate.
Check:
grep 'ssl_verify_client' /var/www/sites/includes/auth-origin.conf
grep 'origin-gate' /var/www/sites/production.conf
ls -l /var/www/certs/cloudflare.pemRemember that current staging, development, and Multisite templates do not enforce the same gate.
Confirm:
grep '^CLOUDFLARE_REAL_IPS=' /var/www/ss-config
grep 'real_ip_header' /var/www/sites/includes/cloudflare.conf
grep -c 'set_real_ip_from' /var/www/sites/includes/cloudflare.conf
sudo nginx -tThen confirm the request actually passed through a proxied Cloudflare DNS record.
Confirm:
ls -l /var/www/meta/cloudflare.ini
sudo certbot certificatesThe current managed credentials file requires the account email and Global API Key format. An API token pasted into CLOUDFLARE_API_KEY will not be converted into the token field expected by the Certbot Cloudflare plugin.
The standard SlickStack Cloudflare integration assumes:
- Cloudflare hosts the public DNS zone
- public website records are proxied
- Nginx receives HTTP and HTTPS traffic from Cloudflare
- the administrator configures the Cloudflare dashboard
- SlickStack manages one primary domain per server
- Cloudflare ranges are downloaded from Cloudflare's public endpoints
CF-Connecting-IPsupplies the visitor address- Authenticated Origin Pulls are optional and currently limited by server-block coverage
- Certbot wildcard validation uses the current Global API Key credentials format
CLOUDFLARE_IPS_ONLYremains disabled until its real-IP conflict is corrected
Cloudflare Workers, Pages, Tunnels, Load Balancing, Spectrum, Argo, SaaS custom hostnames, account-specific Authenticated Origin Pull certificates, automatic DNS management, API-token generation, WAF rule deployment, Cache Rule deployment, Logpush, edge cache purging, and multi-origin failover are outside the standard SlickStack configuration.