So, I thought about a shorter title, but it would have missed the mark. You’ve come to the right page if the URL path you’ve been redirected to looks like this and it seems to never go away:
https://ejemplo.com/z0f76a1d14fd21a8fb5fd0d03e0fdc3d3cedae52f?wsidchk=12345678
Los fundamentos del problema
Esta es una pregunta difícil de explicar, por lo que solo se necesitan algunos conceptos básicos para los lectores no técnicos, pero la mayoría de los que investigan esto serán expertos en tecnología y pueden omitirlo.
El caché es, en resumen, archivos estáticos creados de su sitio web y almacenados en la memoria del servidor, lo que acelera la entrega de su sitio. Ver también¿Qué es el almacenamiento en caché? | ¿Cómo se almacena en caché un sitio web? | Llamarada de la nubepara una explicación simple pero detallada.
TTL significa "Tiempo de vida" y representa la cantidad de tiempo para que los datos almacenados en caché sigan siendo válidos antes de que se vuelvan a crear, se soliciten nuevamente o ambos. El TTL para las páginas web se establece en el encabezado de la página y puede cubrir varios puntos de almacenamiento diferentes, como la caché del servidor perimetral o la caché del navegador. Estos son los dos tipos de caché a los que está conectado este error 404.
Para obtener una explicación detallada de las reglas de Cloudflare, consulte Technoogies.com – “La guía definitiva para las reglas gratuitas y de página de Cloudflare“
¿Qué es Edge Cache TTL?
Cache Everything trata todo el contenido como estático y almacena en caché todos los tipos de archivos más allá del contenido en caché predeterminado de Cloudflare y respeta los encabezados de caché del servidor web de origen, a menos que Edge Cache TTL también esté configurado en la regla de página.
Cuando se combina con un TTL de Edge Cache > 0, Cache Everything elimina las cookies de la respuesta del servidor web de origen.
Aquí está el verdadero problema
The Imunify360 server firewall is running on your web hosting server and will intercede between Cloudflare edge servers and your origin server. When you see this bazaar URL in the address bar with the “404 Not Found” error page then you are likely using Cloudflare and have a Page Rule that has “Cache Everything” combined with “Edge Cache TTL”. It could be a false positive, but even if someone attacks your site, Imunify360 will intervene and Cloudflare will end up caching that output with the redirect causing the 404, so with the Edge Cache TTL controlled by Cloudflare and not the Imunify360 service, Cloudflare cache will not be changed for however long the Edge Cache TTL is set for.
La mejor explicación que encontré está en la comunidad de Cloudflare porcbrandt from February 2022.
“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.”
Por lo tanto, no solo se anula el caché de encabezado TTL de Origin por la configuración TTL de Cloudflare Edge Cache, sino también el encabezado TTL de Imunify360 Edge Cache.
¿Qué hacer?
Lo primero que debe hacer es borrar el caché de Cloudlflare. Eso debería hacer que su sitio sea accesible nuevamente. Para solucionar el problema, no agregar ni configurar Edge Cache TTL junto con la opción Cache Everything debería solucionarlo, así que use Cache Everything, pero elimine la parte Edge Cache TTL de su regla para que Origin TTL sea el valor predeterminado y las páginas de seguridad de Imunify360 Cloudflare tampoco anula TTL.
Cloudflare Page Rules Get Deprecated For Cache Rules
Cloudflare doesn’t recomend Page Rules anymore, but they still have caching rules. They are still available though. The same problem could still occur with Edge Cache TTL in your Cache Rules, so you might consider avoiding the use of Edge Cache TTL settings if your host is using Immunify360.