I have nginx as a reverse proxy to a remote web server. Cache is written to file. However, when I place Varnish in front of it, nginx stops writing to cache file, which causes a performance hit and it doubles the traffic.
How it is possible that a front-end (Varnish) can tell nginx not to cache those requests? I tried to debug but not found anything. My nginx configuration is something like this:
server {
...
location / {
...
proxy_ignore_headers Set-Cookie Expires Cache-Control;
proxy_cache p-cache;
}
}
Again, if I make direct request to nginx, there is no problem. But I have to use Varnish which is the unique door to other service to that server.