I have an apache conf that uses
ProxyPassReverse like this:
ProxyPass /api/v1/ http://navigator:5000/ ProxyPassReverse /api/v1/ http://navigator:5000/
Response headers from the
navigator service that use the
Location field correctly get rewritten so:
ProxyPassReverse doesn't support rewriting the
Link field of the response header, which I use for pagination (much like e.g. https://developer.github.com/v3/#pagination).
So when navigator responds with a header that has the
Link set to:
It won't be rewritten into the expected:
I have not found any other apache module that would do the job, granted I'm no expert on server configuration. I know there are ways to rewrite html/xml links in the response body, but since this is in the header and doesn't really look like html-links, that solution doesn't seem to apply.
How would I get those links rewritten?
Based on the suggested answer, I have the following config that almost does what I want:
Header edit Link "http://navigator:5000/" "/api/v1/"
The configuration is used for several hosts (as an example
localhost:5000) so I can't use a hard coded string.
I could probably leave the link without host specified as a relative link, but I would be most happy if the edit could insert the host used in the request.
I've attempted to have the rewrite part be
"$HTTP_HOST/api/v1/" but none of them give the wanted result.