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.
-
Identify Matching Requests¶
-
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 :
- ON GOING LIVE ON SERA USE THIS User-Agent regex to match crawlers :
- 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.
-
File Extension Pattern¶
- Only the page request patterns should be sent to SERA You can exclude all non-HTML requests using a pattern like : Keep updating this path for any API/sitemap-excluded requests.
-
SERA Internal Request Headers¶
- Exclude the requests with these 2 request-Headers :
-
-
Configure Proxy¶
-
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.
-
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 headerx-nv-sera-token: <token>
) -
SERA Token Addition¶
Add a request header to the above forwarded request with SERA token as :
-
Forwarding Conditions¶
Implement logic to forward requests based on: - Matching user-agent pattern - url pattern to pass only required page requests to SERA
-
-
-
Handle Responses¶
-
Proxy Response¶
- Forward the response from SERA back to the crawlers.
-
-
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: For mobile: If SERA is live, you can use these actual bot user-agent values: For desktop: For mobile:
- WPT and GTMetrix will automatically receive the response from SERA due to the routing rule set above.
- On go-live day, set the user-agent condition regex to actual bot user-agent values. Additionally, ensure that your condition is case-insensitive.