Welcome! Log In Create A New Profile

Advanced

Changing upstream response headers, before nginx caching decisions

Gryzli Bugbear
June 23, 2017 07:32AM
Hello everybody,


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.


Regards

_______________________________________________
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: 258
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