June 24, 2011 01:19PM
Hi,

We need to cache images while reverse proxy with the following settings.

location /foo {
proxy_pass http://www.example.com/foo;
proxy_set_header X-Real-IP $remote_addr;
if ($request_uri ~* \.(jpg|gif)$) {
expires 60d;
add_header Cache-Control private;
}
....

This is working if we use it without reverse proxy. I have tried $upstream_http_request_uri with no luck.

I have tried the following as well.

location /foo/images {
proxy_pass http://www.example.com;
expires 60d;
add_header Cache-Control private;
}
But it matches images in /images directory not in any other directory within the reverse proxy domain.

Please advice how do we properly set browser cache expires while we do reverse proxy.

Thanks in advance
Subject Author Posted

broser cache expires when reverse proxy use

n1xman June 24, 2011 01:19PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 112
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 466 on July 09, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready