I have an API (POST) hosted on apache server, which I want to proxy it to another server. I have done it by using ProxyPass feature. Following is the excerpt:
<VirtualHost *:80>
ServerName mydomain
ServerAlias *.mydomain
ProxyPass /myAPI/ redirectedServer/redirectedAPI/
</VirtualHost>
How ever, I want to add custom headers to the request, based on the value set in one of the parameters in POST request. For e.g. sample requests can be
{"key":"value1"}, {"key":"value2"}
based on the value of "key" coming in the POST request, I want to add different custom headers
{"token":{"value_for_value1"}},{"token":{"value_for_value2 "}}
I was checking the documentation of ReWriteRule/ReWriteMap, but couldn't understand as to how to do it. Can someone please help me?