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

240
Views
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 answers
Answer question

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 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!