Welcome! Log In Create A New Profile

Advanced

Proxy before apache, always MISS

June 14, 2013 08:20PM
Hello everyone,

I use NGINX as a proxy before apache - this part works fine.

Later, I decided to cache all generated images from uri:
bin/* and put them into cache, so I don't get these images generated all the time my apache (so it free up some CPU).

so my nginx config is:
location ~ /bin/(.*) {
expires max;
add_header Last-Modified "Thu, 26 Mar 2000 17:35:45 GMT";

proxy_ignore_headers "Set-Cookie";
proxy_ignore_headers "Cache-Control";

add_header X-Cache-Status $upstream_cache_status;
proxy_pass http://egomuzika.lt;

proxy_cache my-cache;

proxy_cache_key "$host$request_uri";
proxy_cache_valid 200 302 7d;
proxy_cache_valid 404 1m;
}

But this does not work, X-Cache-Status always returns me MISS.
so it seems it enters the location part, but somehow does no do the caching part...

I also tried with:
proxy_cache_key "$host$request_uri$args"; // added $args at the end - with no luck eigher.

Anyone can point me on right directions? Already spend many hours but with no luck at all.

Tried upgrading from nginx 1.2.4 to 1.4.1 - same results :(

Thank you,
Jaroslav
Subject Author Posted

Proxy before apache, always MISS

huglester June 14, 2013 08:20PM

Re: Proxy before apache, always MISS

huglester June 15, 2013 07:25AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 100
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready