404 not found openresty, wsidchk, Imunify360, and Cloudflare

404 introuvable, erreur de redirection openresty, wsidchk, Imunify360 et Cloudflare.

So, I thought about a shorter title, but it would have missed the mark. You’ve come to the right page if the address you’ve been sent to looks like this and it will not go away:

https://example.com/z0f76a1d14fd21a8fb5fd0d03e0fdc3d3cedae52f?wsidchk=12345678

This is not only a Cloudflare related problem. There are several actors in this and is a comedy of errors, so this article update includes the most common scenarios that cause it and an explanation of the moving parts.

The page says 404 Not Found, and down at the bottom it says openresty. Why is that?

The URL in the address bar

That URL path is not a page on your site, and it is not a Cloudflare challenge.

The long path, z0f76a1d14fd21a8fb5fd0d03e0fdc3d3cedae52f, is a check path used by Imunify360 WebShield. The wsidchk part is the check id WebShield handed out for that one request. WebShield sits on the hosting server, as a security layer in front of Apache or Nginx or LiteSpeed, and it is built on OpenResty. That is why the 404 is signed openresty. WordPress never drew that page. Your theme’s 404 never drew it either.

A normal check is supposed to finish. WebShield decides a visitor looks suspicious, sends a short browser check, sets a cookie when the browser passes, and sends the visitor back to the real page. Most people never see it. You get this 404 when that check does not finish. A saved copy of the check is the version that hits every visitor. It is not the only version.

Item of interest: The hash path is not a missing page.

People who dug into this found that the exact hash path gets 404s even when the site is set to send every other missing URL back to the homepage. Add or remove one character and the site’s normal 404 rule works again. WebShield is the thing answering for that one path. The report is in the Cloudflare Community thread from February 2022.

The basics of the problem

Note: Skip this if you already know cache.

This part is here for the nontechnical reader. If you already know what cache and TTL mean, skip it. The next section is the actual problem.

Cache, in short, is a saved copy of a file. The server, or Cloudflare, keeps that copy so it does not have to build the page again for every visitor. Cloudflare has a plain explanation at What is caching?.

TTL means time to live. It is how long a saved copy is allowed to stay before it should be thrown out or fetched again. For web pages, that time can be set for Cloudflare’s edge and for the visitor’s browser. Those are the two copies this 404 gets stuck in.

I wrote a longer walk-through of the free plan and Page Rules at Le guide définitif pour Cloudflare Free et Page Rules.

What Edge Cache TTL does

Cache Everything tells Cloudflare to store all file types, not just the static files it stores by default. HTML is included. On its own, Cache Everything still respects the cache headers your origin sends.

Edge Cache TTL is the override. Once you set it above 0, Cloudflare stops listening to those headers and stores the response for the time you picked.

Item of interest: Edge Cache TTL strips the cookie.

Cloudflare’s own description of that pair, which Imunify360 still quotes in its docs, is this. Cache Everything respects the origin cache headers unless Edge Cache TTL is also set. When it is set above 0, Cache Everything removes cookies from the origin response. Imunify’s write-up of that is in Using Cloudflare Edge Cache TTL, Cache Everything, and Browser Cache TTL with Imunify360.

The cookie is the whole point of the WebShield check. If the saved copy has no cookie, the visitor cannot pass.

Here’s the real problem

Imunify360 is running on the host, between Cloudflare and your site. When WebShield does not like a request, it answers before your site does. A false positive is enough. So is a real attack. The case that takes the whole site down is Cloudflare storing that answer. The other ways you land on the same 404 are in the next section. They do not need a cache rule.

  1. WebShield intercepts the request.
  2. It sends a check instead of your page. In the form cbrandt described on February 7, 2022, that check is a 200 page with JavaScript that points the browser at the hash path, and that path 404s because it is not a real page. He has also described a 302 redirect to the same wsidchk URL. Which one you get depends on how the host has WebShield set. I would not assume every server still does it the 2022 way.
  3. That check is not supposed to be stored. It is sent with a cache header that says no-store, and a passed check sets a cookie.
  4. Edge Cache TTL, or the Cache Rule that acts like it, overrides no-store. Cloudflare stores the check and strips the cookie.
  5. Every visitor after that gets the stored check and gets sent to the 404. The id in that stored page is old, or the cookie never arrived, so the check cannot finish. It stays that way until the stored copy expires, or until you purge it.

The best explanation I found is still cbrandt’s, from that February 2022 Cloudflare Community thread:

When Imunify360 detects a malicious activity, it intercepts the request and sends an interstitial page with a 200 HTTP status code. That page has a JavaScript redirect that points to that path, which then gets a 404 as there’s no such page on your server. The problem is that with Edge Cache TTL, the no-store directive set by the Cache Control header on the interstitial page is overridden, and that page is cached. After that, every visitor will get redirected to the 404 for as long as that interstitial page is not purged from cache.

So the Edge Cache TTL setting overrides the origin, and it overrides Imunify360 too. Imunify does not get to decide how long Cloudflare keeps that page. Cloudflare does.

Imunify’s own docs say the same thing. The WebShield anti-bot challenge is not compatible with aggressive CDN caching, including Cache Everything with Edge Cache TTL, and including Browser Cache TTL. If the challenge page is cached, a visitor sees it from the CDN whether they already passed it or not.

Note: Splash screen is off for Cloudflare by default.

CloudLinux now says the WebShield splash screen is turned off for Cloudflare domains by default. The switch is disable_splash_for_cloudflare in /etc/imunify360-wafd/wafd.conf, and the default is on, meaning the splash is disabled when the visitor came through Cloudflare. Their article was updated June 17, 2026: Is Cloudflare compatible with Imunify360?. That default does not retire this 404. A host can turn the splash back on. Under Attack Mode can still put a domain behind a JavaScript challenge. A greylisted IP can still get a challenge. And a check page that Cloudflare stored last month is still in Cloudflare until somebody purges it. The default only means a current host is less likely to be handing Cloudflare a splash in the first place.

Caution: The old splash config file does nothing.

The old file, /etc/imunify360-webshield/splashscreen-antibot.conf, is deprecated. Editing it does nothing. If a host says they changed that file, they changed the wrong file.

When the 404 is not a cached page

You can land on this address with Cloudflare paused, and with no cache rule at all. The hash path is the check. If the check does not finish, that path has nothing else to show, so OpenResty returns 404.

  1. The browser never finishes the check. Imunify requires cookies and JavaScript to pass it. Hosts that see this tell people to turn both on, wait a minute, reload, and complete the captcha if one is on the page. A privacy tool that blocks the script leaves you on the check URL. That is one visitor and one browser. It is not a stored page.
  2. The client is not a browser. A cron job, a feed reader, curl, or another server calling your site cannot run that JavaScript. It follows the redirect, and the redirect goes to a path that is not a page. People have turned Cloudflare off and still gotten this URL, because the check lives on the host. CloudLinux says the same thing about API access to cPanel, WHM, and webmail. The client cannot pass the check. Whitelist that static IP, or accept that the job will keep failing. There is nothing to fix in a cache rule.

Item of interest: JSON clients get 415 instead.

If that client asked for JSON, or sent Accept: */*, WebShield often skips the HTML check and returns 415 Unsupported Media Type instead. Same greylist. Different page. A log full of 415s is this case, not the cached 404.

  1. The IP is on the greylist. WebShield saw a lot of requests from it, or the address already had a bad reputation. The check is doing what it is there for. It follows that address. If the site loads on a phone and fails on the office network, this is the one. Send the host the public IP, the time, and the full URL.
  2. WebShield is scoring the CDN address instead of the visitor. Behind Cloudflare, visitors share a small set of edge IPs. Imunify can read the real visitor from CF-Connecting-IP, and its docs say it does that for Cloudflare when CDN support is on. If the host is not doing that, WebShield scores the shared edge address. One bad request can put that address on the greylist, and then everybody behind it gets the check. Tell the host the domain is proxied. This one is a host configuration, not a TTL.
  3. Some other cache stored the check. Imunify’s warning covers aggressive CDN caching, not only Cloudflare, and they separately describe an anti-bot loop caused by web page caching that is too aggressive. A host page cache, or a WordPress plugin that saved the HTML, can keep serving the redirect after Cloudflare is clean. Purge those too.
  4. The host turned the challenge on for the domain. The Under Attack Mode does that while a site is being hit. So does turning the splash screen back on, including for Cloudflare, if they changed disable_splash_for_cloudflare. Purging Cloudflare does not turn that switch off.
  5. The link is just dead. wsidchk is an id for one check. Open that same URL later, or let a monitor request it forever, and it 404s because there is no page at that path. If the homepage loads and only that old address fails, you are not looking at a stored homepage. Stop requesting the dead check.

Note: How you tell them apart.

  • Every visitor, on every network, for as long as the TTL, is a stored check.
  • One network fails and another works, that is the IP.
  • Only jobs and feed readers fail, that is a client that cannot run JavaScript.
  • The homepage loads and only an old wsidchk link 404s, that link is dead.

Caution: Do not whitelist a home or mobile IP.

A cron job or an API on a static IP is the case where a whitelist belongs. Ask the host to whitelist that address, and put an end date on it. A home or mobile IP is not that case. Those addresses change, often without you noticing. After the change, you get the check again, and the old address may now belong to someone else. That person then bypasses WebShield on your server. That is the security hole.

What to do

Clear the stored page

If every visitor is stuck, purge the Cloudflare cache first. Caching, then Configuration, then Purge Everything. That is what makes the site reachable again. Purging one URL is not enough if you are not sure which URL got stored. The stored thing is often the real page, homepage included, and that saved copy is what redirects people to the hash.

If it is only you, or only a cron job, do not start by purging the whole zone. Turn JavaScript and cookies on, try the site from a phone, and read the section above. A purge does not take an IP off the greylist, and it does not teach curl how to pass a browser check.

Warning: Changing the rule does not clear the cache.

Changing the rule does not throw out the page Cloudflare already stored. The new rule only stops a bad copy from being saved again. Until you purge, visitors keep getting the old redirect for whatever time you set. If that TTL was a day, you can wait a day, or you can purge. Just purge it.

Warning: Do not turn WebShield off for a cached page.

Do not turn WebShield off to clear a stored page, and do not ask the host to whitelist your home or mobile IP for that. If every visitor is stuck, the page they are getting is a copy Cloudflare saved. Whitelist a home address and it changes next week, and the old address is a security hole you did not mean to leave open. On shared hosting you usually cannot change Imunify yourself anyway. Those settings are root settings, not a cPanel switch. A static IP for a server job is the exception, and it is covered above.

Page Rules

If you still have a Page Rule with Cache Everything and Edge Cache TTL, take the Edge Cache TTL setting off that rule. You can keep Cache Everything. Without the TTL override, Cloudflare goes back to respecting the origin headers, and Imunify’s no-store on the check page can work.

Set Browser Cache TTL to Respect Existing Headers. Do that in the dashboard, not only on the Page Rule. Imunify calls out Browser Cache TTL on its own, because it rewrites the Cache-Control and Expires headers the browser receives. You can fix the edge and still leave a bad copy in the browser.

Note: Move Page Rules caching to Cache Rules.

If you’re still using Page Rules for caching, it is time to move those settings to Cache Rules. Cloudflare is replacing Page Rules with the newer Rules products. Page Rules still work, and Cloudflare says they will migrate existing ones automatically and send a notice first. Cache Rules already override Page Rules when both match the same path, so I would not wait on that notice for this 404.

Caution: Browser Cache TTL can keep the bad redirect.

Browser Cache TTL overrides the headers the browser actually gets. Respect Existing Headers is the setting that stops that. If you leave a long browser TTL in place, a visitor can keep the bad redirect after you have already purged Cloudflare.

Cache Rules

Cloudflare recommends Cache Rules for new work, and Page Rules are on the way out. Their migration guide still says they will move existing Page Rules over automatically, planned for late 2025 or beyond, and that you will get a notice first. I would not wait on that notice to fix this. Cache Rules already override Page Rules when both match the same path.

The names changed. The behavior did not.

  • Eligible for cache is the Cache Rules version of Cache Everything. Cloudflare’s migration guide says choosing Eligible for cache turns Cache Everything on by default.
  • Ignore cache-control header and use this TTL is the Cache Rules version of Edge Cache TTL. This is the one to get rid of. It is the setting that stores the check page and drops the cookie.
  • Use cache-control header if present, use default Cloudflare caching behavior if not. This is the one that lets Imunify’s no-store win. It is the mode their docs point you to when they say to use Cache Rules that respect the origin headers.
  • Use cache-control header if present, bypass cache if not. This is stricter. If a response has no cache header, Cloudflare does not store it. Use this one if you want HTML cached only when your site explicitly says to cache it.

After that, look at Status code TTL on the same rule. This is the part that was easy to miss when the only tool was a Page Rule.

Cloudflare’s default, when a response has no cache header, is about 120 minutes for a 200, 20 minutes for a 302, and 3 minutes for a 404. A WebShield 302 with no cache header can sit at the edge for those 20 minutes. cbrandt’s later fix was to set the 302 time very low. In Cache Rules you can set the 302 status code TTL to no-cache, or to no-store if you want it kept out entirely.

Caution: Status code TTL can rebuild this bug.

A status code TTL ignores cache-control for the codes you list, even when the rest of the rule respects origin headers. If you set a day on 200 through 599, or a long time on 302, you build this bug again with a different control. Leave 302 at no-cache. Do not give 404 a long TTL either. The hash path is a 404, and you do not want that stored for the whole site.

Caution: Cache Rules stack, last match wins.

Cache Rules stack, and the last matching rule wins. Page Rules are the opposite. The first matching Page Rule wins, and the rest are skipped. If you add a bypass for the hash path and an older rule below it still says Eligible for cache with an override TTL, check which one actually runs. Put the bypass where it is the match that wins for z0f76a1d14fd21a8fb5fd0d03e0fdc3d3cedae52f and for any URL whose query contains wsidchk.

Then purge again. Check the live page with a header look, or with curl -sI against the homepage. You want the HTML to stop coming back as a long-lived HIT. A check page should not be what cf-cache-status is serving to every visitor.

If it comes back after a clean purge, the host still has a challenge turned on. Ask them three things.

  • Is the splash screen enabled for Cloudflare domains, or is disable_splash_for_cloudflare still at its default?
  • Is Under Attack Mode on for this domain?
  • Is this IP, or this whole site, on the greylist?

Imunify also has a rare host-side option, append_random_query, for an anti-bot loop that will not break. It adds a random query argument so the cached check cannot match the next request. The downside they publish is that some apps reject query arguments they were not expecting. That one is a host change, and I would only ask for it after the Cloudflare purge and the TTL override are already done.

Questions you may have

Why does the 404 say openresty if my server is Apache?

Because WebShield answered, and WebShield runs on OpenResty. Apache, or whatever is behind it, never got the request that drew that page. If the footer said nginx, or if you got your theme’s 404, I would be looking at a different problem.

I purged, and an hour later the whole site was redirecting again. Why?

The purge cleared the copy. It did not clear the rule that stores the next check. Something tripped WebShield again, Cloudflare stored that new check, and you were back in the same place. Take off Ignore cache-control header and use this TTL, or the old Edge Cache TTL, and then purge once more.

Do I have to stop using Cache Everything?

No. Cache Everything, and Eligible for cache, are fine if they respect the origin headers. The setting that causes this is the override that ignores those headers. Imunify’s wording is that setting Edge Cache TTL along with Cache Everything is not recommended. I would keep the caching and drop the override.

The host says the splash screen is already off for Cloudflare. Can I still get this?

Yes. A stored copy does not care what the host’s default is today. Under Attack Mode and the greylist can still send a challenge. And a 302 with no cache header can be stored for about 20 minutes on Cloudflare’s default, which is long enough to look like the site is down. Ask the host what fired, and check the Cache Rule before you let anybody turn the firewall off.

I paused Cloudflare and I still get the openresty 404. Now what?

Then the check is on the host, which is where it always lived. Turn JavaScript and cookies on, and open the site from a phone. If the phone works, send the host the office IP and the time. If a cron job or a feed reader is the only thing failing, that client cannot pass the check, and the host has to whitelist that static IP. Purging Cloudflare again will not change it.

(Visited 6,007 times, 12 visits today)

Donner un avis

Désistement

Technoogies.com a fait tout son possible pour s'assurer que les informations fournies sont correctes mais ne constituent pas des conseils. Technoogies décline toute responsabilité en cas d'erreur ou d'omission. Les auteurs de Technoogies ne se portent pas garants des sites tiers. Visitez les sites tiers à vos risques et périls. Technoogies n'est pas directement partenaire d'un fournisseur ou d'un tiers. Ce site Web utilise des cookies uniquement pour l'analyse et les fonctions de base du site Web. Technoogies décline toute responsabilité pouvant découler de l'accès aux données présentées sur ce site. Des liens vers des pages internes font la promotion du contenu de Technoogies. Cet article ne constitue pas un avis juridique.

Divulgation des affiliations

Technoogies.com est affilié à Google, Amazone, et d'autres annonceurs. Faire fonctionner ce site coûte de l'argent et s'il ne peut pas se maintenir à travers les publicités, il ira au revoir. S'il vous plaît, aidez-moi à éviter que cela ne se produise avec votre parrainage d'annonces qui vous intéressent.

Pépites de connaissances techniques
Faites défiler jusqu'à Haut