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
http request forwarding according to the http header in apache

I have an apache server that gets http requests with 3 different headers. Depending on the header, I have to send it to backend servers.

Url : abc.com/check

Headers :

"Content-Type: app1"

"Content-Type: app2"

"Content-Type: app3"

Depending on the above header , the request has to be sent to backend app servers .

server1 : http://server1/s1 if "Content-Type: app1"

server2 : http://server1/s2 if "Content-Type: app2"

server3 : http://server1/s3 if "Content-Type: app3"

Please help me out .

Thanks.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I figured it out .Below snippet works our requirement. Some enhancements I'm thinking is to allow only POST requests .

<VirtualHost abc.com:80>
       ServerName abc.com

     RewriteEngine On
     RewriteCond %{HTTP:Content-Type} "app1"
     RewriteRule ^/check http://server1/s1 [P,L]

     RewriteCond %{HTTP:Content-Type} "app2"
     RewriteRule ^/check http://server1/s2 [P,L]

     RewriteCond %{HTTP:Content-Type} "app3"
     RewriteRule ^/check http://server1/s3 [P,L]

</VirtualHost>
over 4 years ago · Santiago Trujillo 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