Howto Remove the Cache-Control request header.

Vincent Blondel vbl5968 at gmail.com
Tue Jan 19 17:02:33 UTC 2021


Hello
Thank You for the help
I made some errors in my checks and confirm it is doing the job
Thank You
Vincent

On Sun, Jan 17, 2021 at 1:16 AM Francis Daly <francis at daoine.org> wrote:

> On Sat, Jan 16, 2021 at 07:11:54PM +0100, Vincent Blondel wrote:
>
> Hi there,
>
> > We want nginx to remove the request header Cache-Control before to proxy
> > the request to the OCS.
> > We do like this ...
>
> 'proxy_set_header Cache-Control "";' appears to work for me.
>
> Can you show one request to nginx with the header, and the matching
> request to the upstream server?
>
> When I use this config:
>
> ==
> server {
>     listen 7000;
>     add_header X-7000 "cache :$http_cache_control:";
>     location /a {
>         proxy_set_header Cache-Control "";
>         proxy_pass http://127.0.0.1:7001;
>     }
>     location /b {
>         proxy_pass http://127.0.0.1:7001;
>     }
> }
>
> server {
>     listen 7001;
>     add_header X-7001 "cache :$http_cache_control:";
>     location / {
>         return 200 "7001: $request_uri\n";
>     }
> }
> ==
>
> if I make a request to port 7000 that starts with /b and includes a
> Cache-Control header, I see in the X-7001 response header that that same
> Cache-Control header was sent to the upstream; but if I make a request
> that starts with /a, I see in the X-7001 response header that it was
> removed before the request was made to the upstream.
>
> That is:
>
> curl -i -H Cache-control:no-cache http://127.0.0.1:7000/b1
>
> includes
>
> X-7001: cache :no-cache:
> X-7000: cache :no-cache:
>
> while
>
> curl -i -H Cache-control:no-cache http://127.0.0.1:7000/a1
>
> includes
>
> X-7001: cache ::
> X-7000: cache :no-cache:
>
> Does your system respond differently?
>
>         f
> --
> Francis Daly        francis at daoine.org
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20210119/67b3c846/attachment.htm>


More information about the nginx mailing list