Welcome! Log In Create A New Profile

Advanced

Re: Changing upstream response headers, before nginx caching decisions

Gryzli Bugbear
June 23, 2017 08:14AM
Hi Maxim,

Thanks for your prompt answer !

That's exactly what I'm using currently, but was thinking if there is
some more elegant/performance-effective way of doing this thing.


Regards


On 06/23/2017 03:09 PM, Maxim Dounin wrote:
> Hello!
>
> On Fri, Jun 23, 2017 at 02:31:37PM +0300, Gryzli Bugbear wrote:
>
>> I have the following working scheme:
>>
>> Client --> Nginx [caching] --> Apache [backend]
>>
>>
>> Sometime the backend returns headers, which I want to modify before
>> nginx caching engine decides how to treat them. One such example is when
>> backend returns Vary: header.
>>
>>
>> I want to achieve the following:
>>
>>
>> [Apache backend returns Vary: User-Agent, Header2] --> [Nginx Modifies
>> "Vary:" and removes User-Agent] --> [Nginx caching sees only 'Vary:
>> Header2' (without User-Agent)] --> The final result is that Nginx cache
>> wont take 'User-Agent' into vary considerations. (no cache object per UA).
>>
>> That's just an example. I would like to do such modification with other
>> headers also (for example Cache-Control).
>>
>> Currently I'm already using Nginx Lua integration, but there is no hook
>> point before the caching engine.
>>
>>
>> Would be happy for any suggestions about achieving this scenario.
> As of now, the only solution would be to use intemediate proxy
> (without caching) to modify headers returned by your backend.
>

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Changing upstream response headers, before nginx caching decisions

Gryzli Bugbear June 23, 2017 07:32AM

Re: Changing upstream response headers, before nginx caching decisions

Maxim Dounin June 23, 2017 08:10AM

Re: Changing upstream response headers, before nginx caching decisions

Gryzli Bugbear June 23, 2017 08:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 128
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready