Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

233
Views
How to modify index.html file in build folder before sending it on each request with Nginx server?

I want to modify the React's index.html file in the server before sending it to the browser on request. Reason is that, I want to include open graph meta tags into the head according to the request url. How can I achieve that with Nginx server ?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Couple of options here.

Use NGINX subs module

http://nginx.org/en/docs/http/ngx_http_sub_module.html

sub_filter '<a href="http://127.0.0.1:8080/' '<a href="https://$host/';

Use NGINX njs

http://nginx.org/en/docs/http/ngx_http_js_module.html#js_body_filter

You can use njs and js_body_filter to filter the response body. Personally, I would use the njs way as you are more flexible in adding / changing data.

Make sure you are loading the ngx_http_js_module in your main nginx.conf file.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!