apache http server

apache- Setup http proxy to add header to Http Headers

In this post i will guide how to setup http proxy to add header to http headrs. To do that we need following plugin:

  • mod_headers

Make sure you’d intalled two above plugin. Add follow config to httpd.conf (change value as your expectation)

ProxyPass / http://localhost:8080/myapp
ProxyPassReverse / http://localhost:8080/myapp
Header set sample_header "sample_value"
RequestHeader set sample_header "sample_value"

Header will add header to http response
RequestHeader will add header to http request.

This plugin very useful for you to know where the request come from when you have many proxy route to web application
You can read more on mod_header document here

Leave a Reply