Skip to content

SERA integration on other web-servers

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

  1. Identify Matching Requests

    1. User-Agent Pattern

      • Requests matching with 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)/
          
    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 path for any API/sitemap-excluded requests.
    3. SERA Internal Request Headers

      • Exclude the requests with these 2 request-Headers :
        x-nv-app
        
        x-nv-sera-bypass
        
  2. Configure Proxy

    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. Proxy

      • Proxy Target

        Set the proxy target to the SERA server i.e. https://sera.n7.io/
        e.g. Below page :
        https://www.example.com/app/1v1/home.html
        should be proxied to SERA like :
        https://sera.n7.io/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 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

    1. Proxy Response

      • Forward the response from SERA back to the crawlers.
  4. Testing and Refinement

    • Keep refining the logic by adjusting 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 browser, you can use DevTools > Network conditions facility, or some 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.