Re: RE: Setting a custom header based on another upstream/sent header

2019-08-22 Thread fevangelou
Thank you Reinis - that did it :) Posted at Nginx Forum: https://forum.nginx.org/read.php?2,285363,285374#msg-285374 ___ nginx mailing list nginx@nginx.org http://mailman.nginx.org/mailman/listinfo/nginx

RE: Setting a custom header based on another upstream/sent header

2019-08-22 Thread Reinis Rozitis
> Is this expected behaviour? Could there be another way to do this? 'if' (the rewrite module) is executed in early stages when $sent_* variables are not available that’s why the regex doesn't match. What you could do is use 'map' instead: (http://nginx.org/en/docs/http/ngx_http_map_module.html

Setting a custom header based on another upstream/sent header

2019-08-22 Thread fevangelou
Hi there, I'm trying (unsuccessfully) to read an upstream/sent response header and set an additional one based on some regex. Let's say I want to check if the site served is WordPress. WordPress will usually output a link header like this: link: ; rel="https://api