Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

241
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda