Title: Possible bug with loopback test
Last modified: March 26, 2026

---

# Possible bug with loopback test

 *  Resolved [iowebgr](https://wordpress.org/support/users/iowebgr/)
 * (@iowebgr)
 * [2 months ago](https://wordpress.org/support/topic/possible-bug-with-loopback-test/)
 * Hi, I’m observing something odd when running the plugin’s cache health / loopback-
   style checks on my setup, and I wanted to ask whether this could be a bug in 
   how the test target URL is built.
    My topology is: – public site URL: [https://example.com](https://example.com)–
   WordPress runs behind nginx – Varnish is exposed only on a localhost port, for
   example 127.0.0.1:57005 – that Varnish port is plain HTTP, not HTTPS – the plugin
   is configured to target Varnish through VHP_VARNISH_IP=127.0.0.1:57005 So the
   intended flow is effectively: – browser -> public nginx -> Varnish – plugin purge/
   health checks -> 127.0.0.1:57005 with Host: example.com What I observe is: – 
   the site itself works properly in the browser – direct HTTP requests to the Varnish
   loopback port work when sent like this: curl -H ‘Host: example.com’ [http://127.0.0.1:57005/](http://127.0.0.1:57005/)–
   but the plugin reports: Could not reach any site URLs. Your server may block 
   loopback requests. From reading the behavior, it looks like the test may be preserving
   the original site scheme from home_url(), which is HTTPS, and then rewriting 
   only the host/port to VHP_VARNISH_IP. If that is what’s happening, the resulting
   request would become something like: [https://127.0.0.1:57005/](https://127.0.0.1:57005/)
   with: Host: example.comIt’s my understanding that direct requests to Varnish 
   in this kind of setup should normally still use plain HTTP transport, and the
   original frontend scheme should be distinguished separately, for examplevia X-
   Forwarded-Proto, rather than by trying to speak HTTPS directly to the localhost
   Varnish port.
 * So in this case, the loopback target itself appears reachable, but the scheme
   used for the rewritten health-check URL would be wrong for that endpoint.
 * My guess is that this may explain the misleading “server may block loopback requests”
   result in cases where loopback is actually fine.
 * I wanted to ask:
    - could the health check force http:// when VHP_VARNISH_IP is used as a host:
      port override?
    - or alternatively support an explicit scheme-aware override?
    - if preserving the original scheme is intentional, would it make sense to at
      least improve the error message so it distinguishes real loopback blocking
      from a protocol mismatch? I may be misunderstanding the intended behavior,
      but from my testing this looks like a possible false negative in the loopback
      test on HTTPS sites using a plain HTTP localhost Varnish port.
 * ON wordpress itself the URL is set as [https://example.com](https://example.com)
 * PS: The full cache test is all greens
 *     ```wp-block-code
       Connectivity TestVerify connection to cache serverConnected to: 127.0.0.1:57005Create Test PostCreate a temporary post with unique contentCreated post: #117Prime CacheRequest the post to populate the cacheHTTP 200x-cache: MISSx-varnish: 1212439age: 0via: 1.1 af90f568aa14 (Varnish/7.7)Verify CachingModify post and confirm cache serves stale contentCache is serving stale content ✓x-cache: HITx-varnish: 1212442 1212440age: 2via: 1.1 af90f568aa14 (Varnish/7.7)Trigger PurgeSend PURGE request to invalidate cached contentPURGE sent for: https://example.com/vhp-cache-test-2026-03-26-175458/Verify PurgeConfirm fresh content is now servedFresh content now being served ✓x-cache: HITx-varnish: 1277957 1212447age: 2via: 1.1 af90f568aa14 (Varnish/7.7)CleanupDelete test post and temporary dataTest post deleted
       ```
   

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Danila Vershinin](https://wordpress.org/support/users/dvershinin/)
 * (@dvershinin)
 * [2 months ago](https://wordpress.org/support/topic/possible-bug-with-loopback-test/#post-18864368)
 * Hi [@iowebgr](https://wordpress.org/support/users/iowebgr/),
 * Great catch — you nailed the diagnosis. The health score widget was indeed preserving
   the site’s HTTPS scheme when rewriting the URL with VHP_VARNISH_IP, resulting
   in an HTTPS request to a plain HTTP Varnish port. The connection would fail silently,
   and all URLs would be skipped, triggering the misleading “server may block loopback
   requests” message.
 * This is fixed in version 5.8.2 (just released). The health score now always uses
   http:// when connecting directly to the Varnish daemon via VHP_VARNISH_IP, since
   Varnish listens on plain HTTP regardless of the site’s public scheme.
 * Thanks for the detailed report — it made the fix straightforward.
 *  Thread Starter [iowebgr](https://wordpress.org/support/users/iowebgr/)
 * (@iowebgr)
 * [2 months ago](https://wordpress.org/support/topic/possible-bug-with-loopback-test/#post-18864424)
 * Hi great news 🙂 I can confirm the change worked and the score is reported perfectly
   fine
 * ![](https://wordpress.org/bf4d7002-9793-4153-8146-f4359bb13e9b)
 * Thank you very much for the super fast fix 🙂
    -  This reply was modified 2 months ago by [iowebgr](https://wordpress.org/support/users/iowebgr/).
 *  Plugin Author [Danila Vershinin](https://wordpress.org/support/users/dvershinin/)
 * (@dvershinin)
 * [2 months ago](https://wordpress.org/support/topic/possible-bug-with-loopback-test/#post-18864454)
 * You’re welcome and thanks again for reporting it!

Viewing 3 replies - 1 through 3 (of 3 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fpossible-bug-with-loopback-test%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/varnish-http-purge/assets/icon-256x256.png?rev=3027185)
 * [Proxy Cache Purge](https://wordpress.org/plugins/varnish-http-purge/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/varnish-http-purge/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/varnish-http-purge/)
 * [Active Topics](https://wordpress.org/support/plugin/varnish-http-purge/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/varnish-http-purge/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/varnish-http-purge/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Danila Vershinin](https://wordpress.org/support/users/dvershinin/)
 * Last activity: [2 months ago](https://wordpress.org/support/topic/possible-bug-with-loopback-test/#post-18864454)
 * Status: resolved