Skip to content
  • There are no suggestions because the search field is empty.

How do I integrate Prerender with HAProxy?

Route AI crawler and search engine requests through Prerender using a community-maintained HAProxy configuration.

TL;DR

Integrate Prerender with HAProxy by adding a configuration block that intercepts crawler requests and routes them through Prerender's rendering solution. This is a community-maintained integration — Prerender provides this guide as a reference but does not officially support HAProxy-specific issues. You'll need your Prerender token, access to your HAProxy config file, and about 20–30 minutes to set up and verify.


⚠️ Community-maintained integration
This integration is maintained by the community, not Prerender. Our support team can help with Prerender-side questions, but cannot troubleshoot HAProxy configuration issues directly. For HAProxy-specific questions, consult the GitHub source or HAProxy documentation.

ℹ️ Not sure which integration fits your stack? Ask Nexus, your AI integration assistant in your Prerender dashboard — describe your setup and Nexus will recommend the right approach and walk you through it.


Step 1: Open your Prerender dashboard and copy your token

  1. Log in to your Prerender dashboard.
  2. Go to Security and Access and copy your Prerender token.

ℹ️ Don't have a Prerender account yet? Sign up at prerender.io before continuing.

You'll replace the YOUR_TOKEN placeholder with this token in Step 3.


Step 2: Copy the HAProxy configuration from GitHub

The community-maintained HAProxy configuration is available on GitHub:

👉 View the HAProxy config source

Copy the full configuration from the gist. You'll edit the placeholders in Step 3 before adding it to your HAProxy config file.


Step 3: Edit the configuration for your site

Open the copied configuration and make the following changes before saving:

  1. Replace YOUR_TOKEN with the Prerender token you copied in Step 1.
  2. Replace http://example.com with your website's base URL.
  3. Review the timeout server value — the default is 20s. Increase it if your pages typically take longer to render.

ℹ️ The configuration excludes static assets (images, CSS, JS, and similar files) from being routed to Prerender. This is intentional — static assets don't require rendering.

Once edited, add the configuration to your HAProxy config file.


Step 4: Configure SSL if your site uses HTTPS

If your site runs on HTTPS, additional SSL configuration is required in HAProxy before the integration will work correctly.

 


Step 5: Test the configuration in a staging environment

Before deploying to production, apply the updated configuration to a staging environment and confirm that crawler requests are being routed correctly.

ℹ️ Testing in staging first reduces the risk of a misconfiguration affecting your live site. An invalid HAProxy config will prevent the service from loading — back up your existing config file before making changes.


Step 6: Deploy to production and reload HAProxy

Apply the updated configuration to your production HAProxy instance and reload the service for the changes to take effect.


Step 7: Verify your integration

Confirm that Prerender is correctly intercepting crawler requests and serving rendered HTML before you consider the setup complete.

Follow the steps in How do I verify my Prerender integration? to test your setup.

You can also run a quick test from the command line using curl with a bot User-Agent:

curl -v -A googlebot www.yourpage.com/ 

✅ Your integration is working when cached pages appear in your Prerender dashboard within a few minutes of your first crawler request, and Prerender response headers are visible in the verification tool.

If you don't see Prerender headers or IDs in the verification output, the integration is not active. Check that YOUR_TOKEN has been replaced with your actual token, and that the route pattern in your config matches the URLs you're testing.

If you see "Prerender Integration Not Detected," follow the steps in What should I do if I receive a "Prerender Integration Not Detected" error? to resolve it.


💬 Still need help?
If you're running into issues with your HAProxy integration, our support team can help with Prerender-side questions. For HAProxy-specific configuration issues, consult the community or HAProxy documentation directly.
→ Contact us at support@prerender.io


Related articles

Was this article helpful?