Skip to content

SERA integration on other web-servers

If you are using a web-server for which SERA integration steps are not provided here, just follow the steps below.
Sending requests to SERA is simple: all you need is a SERA token and a simple proxy configuration.

1. Identify Matching Requests

1.1 User-Agent Pattern

  • Requests matching only the mentioned bot user-agents should be sent to SERA.
    You can define a regular expression or other matching criteria to identify requests that should be proxied to SERA.
  • DURING POC PHASE use this User-Agent regex to match crawlers:

    /(n7TestUserAgent|PTST|GTmetrix)/
    
  • ON GOING LIVE ON SERA use this User-Agent regex to match crawlers:

    /(googlebot|google\ page\ speed|chrome-lighthouse|google-inspectiontool|PTST|GTmetrix)/
    

1.2 File Extension Pattern

  • Only the page request patterns should be sent to SERA.
    You can exclude all non-HTML requests using a pattern like:
~*\.(ai|ashx|asmx|aspx|avi|avif|bmp|css|csv|dat|dmg|doc|eot|exe|flv|gif|ico|iso|jpeg|jpg|js|json|jsp|less|m4a|m4v|mov|mp3|mp4|mpeg|mpg|ogg|otf|pdf|php|png|ppt|psd|rar|rss|svg|swf|tif|torrent|tf|txt|wav|webm|webp|wmv|woff|woff2|xls|xml|zip)

Keep updating this pattern for any API/sitemap-excluded requests.

1.3 Page Exclusion Pattern

  • Some page requests should never be sent to SERA, e.g., login or checkout flow.
    You can exclude them using a pattern like:
~*.*/(api|login|logout|account|wishlist|cart|checkout|payment).*

Keep updating this pattern for any API/sitemap-excluded requests.

1.4 GMC Query Parameter Pattern

  • You need to add the "nsbp" query parameter to all product page URLs in the GMC feed.
    These requests should be sent to the origin instead of SERA to always fetch the latest content (to avoid GMC exclusions due to old data).
    You can use a regex like below:
~*.*\?(.*&)*nsbp=.*

1.5 SERA Internal Request Headers

  • Exclude the requests with these 2 request headers:
x-nv-app
x-nv-sera-bypass

2. Configure Proxy

2.1 Proxy Server/Module

Use a proxy server or module that supports conditional forwarding based on request headers.
Examples include: Nginx (for reference, not implementation-specific), Apache HTTPd with mod_proxy.

2.2 Proxy

Proxy Target

Set the proxy target to the SERA server endpoint shared with you
For example, the page:
https://www.example.com/app/1v1/home.html
should be proxied to SERA like:
https://SERA_ENDPOINT/app/1v1/home.html
(with request header x-nv-sera-token: <token>)

SERA Token Addition

Add a request header to the above forwarded request with the SERA token as:

x-nv-sera-token: <your-token>

Forwarding Conditions

Implement logic to forward requests based on:

  • Matching user-agent pattern
  • URL pattern to pass only required page requests to SERA

3. Handle Responses

3.1 Proxy Response

  • Forward the response from SERA back to the crawlers.

4. Testing and Refinement

  • Keep refining the logic by adjusting the user-agent list and SERA exclusion patterns as needed.

  • Test thoroughly:

  • WPT and GTMetrix will automatically receive the response from SERA due to the routing rule set above.

    • Steps to validate page using WPT
  • To check the SERA rendered page on a browser, you can use DevTools > Network conditions facility, or a browser extension (like Simple modify headers) to manipulate the browser user-agent.
    If in testing phase, use these user-agent values:
    For desktop:

n7TestUserAgent

For mobile:

n7TestUserAgent; Android

If SERA is live, you can use these actual bot user-agent values:
For desktop:

Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; Googlebot/2.1; +<http://www.google.com/bot.html)> Chrome/W.X.Y.Z Safari/537.36

For mobile:

Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/W.X.Y.Z Mobile Safari/537.36 (compatible; Googlebot/2.1; +<http://www.google.com/bot.html)>
  • On go-live day, set the user-agent condition regex to actual bot user-agent values. Additionally, ensure that your condition is case-insensitive.

  • Whitelist SERA requests at your origin to avoid any issues with indexing. Details are here

  • After go-live, in any dashboards created for monitoring the "actual user traffic" (e.g., Google Analytics), exclude the requests with user-agent string containing the word "Nitrogen SERA" to get a correct understanding about user traffic.