In Apache if I make a request that contains multiple Link
headers, it will merge them into one comma separated list.
In nginx, if I make the same request all but the last are discarded
For example, with the following request:
PUT https://example.org HTTP/1.1
Link: </some/path>; rel="parent"
Link: </another/path>; rel="child"
Using Apache, the PHP $_SERVER['HTTP_LINK']
variable will contain the following:
</some/path>; rel="parent", </another/path>; rel="child"
However in nginx, the variable will be:
</another/path>; rel="child"
Is there a feature toggle in nginx config I can turn on to mimic Apache's behaviour?
UPDATE:
I should add that I am using PHP-FPM as a fastcgi_pass. I added the following to the nginx config which passes the first Link
header instead of the last:
fastcgi_param HTTP_LINK $http_link;
I wonder if there's any way to access $http_link
as an array and split it myself in the config file.
It looks like this is a known bug in nginx: https://trac.nginx.org/nginx/ticket/1316 and https://trac.nginx.org/nginx/ticket/1762
The original ticket is over two years old now which is disappointing as it doesn't seem to be a priority for the devs.
The only solution I can think of for now is to parse the
Link
headers at the client end and combine them into one before the request is made.