Title: %{HTTPS} check fails behind nginx proxy
Last modified: September 30, 2026

---

# %{HTTPS} check fails behind nginx proxy

 *  [wimmelstein](https://wordpress.org/support/users/wimmelstein/)
 * (@wimmelstein)
 * [19 hours, 12 minutes ago](https://wordpress.org/support/topic/https-check-fails-behind-nginx-proxy/)
 * WP Fastest Cache 1.5.2, PHP 8.3, Apache behind nginx (ISPmanager shared hosting;
   nginx terminates TLS and proxies to Apache over HTTP), Cloudflare in front.
   Every
   cached page ends with `<!-- via php -->`, and the time to first byte stays at
   0.4–0.9 s. The `.htaccess` rules never match, because the first condition is:
 * RewriteCond %{HTTPS} on
 * Behind a proxy that terminates TLS, Apache sees the connection as plain HTTP,
   so `%{HTTPS}` is off, even though the visitor uses HTTPS. The proxy does send`
   X-Forwarded-Proto: https`.
 * **Workaround:** this change makes Apache serve the cache directly (TTFB dropped
   to about 80 ms):
 * RewriteCond %{HTTPS} on [OR]
   RewriteCond %{HTTP:X-Forwarded-Proto} https
 * But WP Fastest Cache overwrites it whenever the settings are saved.
 * **Request:** could the generated rules also accept `%{HTTP:X-Forwarded-Proto}
   https` (and perhaps `%{HTTP:X-Forwarded-SSL} on`), or offer a setting for it?
   This setup is common on shared hosting and behind Cloudflare with Flexible SSL.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Emre Vona](https://wordpress.org/support/users/emrevona/)
 * (@emrevona)
 * [15 hours, 50 minutes ago](https://wordpress.org/support/topic/https-check-fails-behind-nginx-proxy/#post-19033519)
 * Can you contact us via email please?
 * [https://www.wpfastestcache.com/contact-us/](https://www.wpfastestcache.com/contact-us/)

Viewing 1 replies (of 1 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhttps-check-fails-behind-nginx-proxy%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/wp-fastest-cache/assets/icon-256x256.png?rev=2064586)
 * [WP Fastest Cache - WordPress Cache Plugin](https://wordpress.org/plugins/wp-fastest-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-fastest-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-fastest-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-fastest-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-fastest-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-fastest-cache/reviews/)

## Tags

 * [cloudflare](https://wordpress.org/support/topic-tag/cloudflare/)
 * [htaccess](https://wordpress.org/support/topic-tag/htaccess/)
 * [HTTPS](https://wordpress.org/support/topic-tag/https/)
 * [nginx](https://wordpress.org/support/topic-tag/nginx/)
 * [reverse proxy](https://wordpress.org/support/topic-tag/reverse-proxy/)

 * 1 reply
 * 2 participants
 * Last reply from: [Emre Vona](https://wordpress.org/support/users/emrevona/)
 * Last activity: [15 hours, 50 minutes ago](https://wordpress.org/support/topic/https-check-fails-behind-nginx-proxy/#post-19033519)
 * Status: not resolved