Apache
Cloudflare
Apache es un software de servidor web de código abierto que facilita la entrega de páginas web a través de Internet. Es altamente configurable y ampliamente utilizado en el alojamiento de sitios web debido a su estabilidad y flexibilidad.

Integrando PERENDER con Apache.

Paso 1.

Habilite los siguientes módulos en el fichero httpd.conf:

1. headers_module
2. proxy_module
3. proxy_http_module
4. ssl_module
5. rewrite_module
Para ello descomente la línea LoadModule de cada módulo anterior en el fichero httpd.conf.

Luego añada en el fichero httpd.conf el siguiente código para permitir el proxy a través de https.

<IfModule mod_ssl.c>
         SSLProxyEngine On
</IfModule>

Paso 2.

1. Luego cree un fichero .htaccess en la raíz de su aplicación.
Notas:
Si su aplicación ya cuenta con el fichero .htaccess incluya el siguiente código.
Si en su fichero .htaccess ya cuenta con reglas de reescritura debe incluir la regla de PERENDER al inicio de las mismas y quitar [END] del código proporcionado para permitir que se evalúen tus siguientes reglas de reescritura.

2. Dentro del código proporcionado reemplace [PERENDER_TOKEN] por su toquen en el dashboard de PERENDER.

Repositorio github en la siguiente dirección https://github.com/perender/perender-apache/blob/main/.htaccess
<IfModule mod_headers.c>
 RequestHeader set Authorization "Bearer [PERENDER_TOKEN]"
</IfModule>
<IfModule mod_rewrite.c>
 RewriteEngine On
 <IfModule mod_proxy_http.c>
 RewriteCond %{HTTP_USER_AGENT} googlebot|bingbot|msnbot|adidxbot|yahoo!\ slurp|qwantify|petalbot|bytespider|sogou\ web\ spider|sogou\ inst\ spider|exabot|seznambot|naverbot|yetibot|yandexbot|yandeximages|yandexaccessibilitybot|perplexity|perplexitybot|oai-searchbot|chatgpt|gptbot|claudebot|cohere-ai|youbot|facebookexternalhit|twitterbot|linkedinbot|embedly|quora\ link\ preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|slackbot-linkexpanding|vkShare|W3C_Validator|w3c-checklink|whatsapp|redditbot|applebot|flipboard|flipboardproxy|flipboardrss|tumblr|bitlybot|skypeuripreview|nuzzel|discordbot|snapchat|viber|mattermost|telegrambot|chrome-lighthouse|lighthouse|google\ page\ speed|siteimprove|serpstatbot|uptimerobot|uptimebot|pingdom|gtmetrix|majestic-12|mj12bot|semrushbot|ahrefsbot|dotbot|screaming\ frog\ seo\ spider|seokicks|rogerbot|360spider|soso|baiduspider-render|bitrix\ link\ preview|xing-contenttabreceiver|integration-test|google-inspectiontool|amazonbot|adsbot-google|googlebot-image|googlebot-news|googlebot-video|facebot|archive.org_bot|paperlibot|dataprovider.com|grapeshotcrawler|zoominfobot|feedly|feedlybot|newsblur|inoreader|ccbot [NC,OR]
 RewriteCond %{QUERY_STRING} _escaped_fragment_
 RewriteCond %{REQUEST_URI} ^(?!.*?(\.js|\.json|\.css|\.xml|\.less|\.png|\.jpg|\.jpeg|\.gif|\.pdf|\.doc|\.txt|\.ico|\.rss|\.zip|\.mp3|\.rar|\.exe|\.wmv|\.avi|\.ppt|\.mpg|\.mpeg|\.tif|\.wav|\.mov|\.psd|\.ai|\.xls|\.mp4|\.m4a|\.swf|\.dat|\.dmg|\.iso|\.flv|\.m4v|\.torrent|\.ttf|\.woff|\.svg|\.webmanifest|\.webp))
 RewriteRule ^(index\.html|index\.php)?(.*) "https://api.perender.com/render?url=%{REQUEST_SCHEME}://%{HTTP_HOST}$2&botAgent=apache" [P,END,NE] 
 </IfModule> 
</IfModule>


Powered by AstrolUi
An unhandled error has occurred. Reload 🗙