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 ?
Couple of options here.
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/';
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.