I have a simple apache vhost:
<VirtualHost *:80>
ServerName hello.local
ProxyPass / http://localhost:8810/
ProxyPassReverse / http://localhost:8810/
</VirtualHost>
All request to hello.local are proxyed to http://localhost:8810/
.
What I'd like to do is add a header to the http request going to http://localhost:8810/
with a value returned by an external command. Something like
Header set MyHeader ${/usr/bin/an_external_program}
Any way to accomplish this?
Ok I got it.
First of all, the script that is executed and that is used to get the value to insert in the header. I created this as
/opt/apache/debug.sh
:Apache config:
The backend service running on
http://localhost:8080/
receives thecustomheader
with the value from the script.The Apache documentation about using external program is here.