Need integration help? Contact our engineering team
Please choose the option as per your server configuration from the side menu and follow the instructions

Nginx Integration Guide

Integrate Index Render at the web server level using Nginx. This method is highly efficient and works with any backend technology by intercepting bot traffic before it reaches your application.

Server-Side Detection Integrating at the Nginx level ensures zero overhead for your application code and provides a robust solution for bot management.
1

Configure Bot Mapping

Add the following map directives inside your http block in nginx.conf. This logic defines which User-Agents should be treated as bots and forwarded for pre-rendering.

nginx.conf (Bot Detection)
# Define which User-Agents are search engine bots or AI crawlers
map $http_user_agent $is_bot_ua {
        default                                     0;
        "~*IndexRender"                             0;
        "~*googlebot"                               1;
        "~*bingbot"                                 1;
        "~*yandex"                                  1;
        "~*baiduspider"                             1;
        "~*facebookexternalhit"                     1;
        "~*twitterbot"                              1;
        "~*rogerbot"                                1;
        "~*linkedinbot"                             1;
        "~*embedly"                                 1;
        "~*quora\ link\ preview"                    1;
        "~*showyoubot"                              1;
        "~*outbrain"                                1;
        "~*pinterest"                               1;
        "~*slackbot"                                1;
        "~*vkshare"                                 1;
        "~*w3c_validator"                           1;
        "~*redditbot"                               1;
        "~*applebot"                                1;
        "~*whatsapp"                                1;
        "~*flipboard"                               1;
        "~*tumblr"                                  1;
        "~*bitlybot"                                1;
        "~*skypeuripreview"                         1;
        "~*nuzzel"                                  1;
        "~*discordbot"                              1;
        "~*google\ page\ speed"                     1;
        "~*qwantify"                                1;
        "~*pinterestbot"                            1;
        "~*bitrix\ link\ preview"                   1;
        "~*xing-contenttabreceiver"                 1;
        "~*telegrambot"                             1;
        "~*google-inspectiontool"                   1;
        "~*petalbot"                                1;
        "~*duckduckbot"                             1;
        "~*bytespider"                              1;
        "~*gptbot"                                  1;
        "~*chatgpt-user"                            1;
        "~*claudebot"                               1;
        "~*perplexitybot"                           1;
        "~*ahrefsbot"                               1;
        "~*semrushbot"                              1;
        "~*mj12bot"                                 1;
        "~*googlebot"                               1;
        "~*googlebot-image"                         1;
        "~*googlebot-video"                         1;
        "~*googlebot-news"                          1;
        "~*googleother"                             1;
        "~*apis-google"                             1;
        "~*facebookcatalog"                         1;
        "~*facebot"                                 1;
        "~*linkedinbot"                             1;
        "~*twitterbot"                              1;
        "~*slack-imgproxy"                          1;
        "~*slurp"                                   1;
}

# Exclude static assets from being sent to the renderer
map $uri $is_bot {
    default $is_bot_ua;
    "~*\.(js|css|xml|less|png|jpg|jpeg|gif|pdf|txt|ico|rss|zip|mp3|rar|exe|wmv|doc|avi|ppt|mpg|mpeg|tif|wav|mov|psd|ai|xls|mp4|m4a|swf|dat|dmg|iso|flv|m4v|torrent|ttf|woff|woff2|svg|eot)$" 0;
}
2

Set Up Proxy Routing

Inside your server block, add an if check to forward bot traffic to the Index Render API.

nginx.conf (Routing)
server {
    listen 80;
    server_name example.com;

    location / {
        # If the request is from a bot, proxy to Index Render
        if ($is_bot = 1) {
            # Set your API Key header
            proxy_set_header x-indexrender-key "your_api_key_here";
            proxy_set_header Accept "text/html";
            
            # Forward the request to the pre-rendering API
            proxy_pass https://api.indexrender.io/api/v1/render?url=$scheme://$host$request_uri;
            break;
        }

        # For normal users, serve from your application
        proxy_pass http://127.0.0.1:3000;
        
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
3

Verify Integration

To confirm that your integration is active, send a request to your URL while simulating a search engine bot. Run the following command in your terminal:

Terminal
curl --location 'https://yourdomain.com' \
--header 'User-Agent: googlebot'

In the <head> section of the response, you should see the Index Render metadata tags indicating the page was successfully pre-rendered:

Expected Output
<!--IndexRender-->
<meta name="generator" content="IndexRender/65d6cde" />
<meta name="x-rendered-by" content="IndexRender/65d6cde" />
<meta name="x-rendered-at" content="2026-04-26T18:26:03.1076251Z" />
<meta name="x-render-traceparent" content="00-39f1dd04eeba1243cae01dc5c70e5b47-cdf5cfae992740d8-01" />