Quantcast
Viewing latest article 1
Browse Latest Browse All 2

Answer by Michael Hampton for Forwarding request when serving from NGINX cache - Is this possible?

This doesn't appear to be possible. The mirror directive is processed as a subrequest to the original request, so if nginx does not process the original request, the mirror request will also not be processed.

As a workaround, you can add a second custom access_log directive, which uses a custom log_format. Your program can then read this log to determine when a cache hit occurred and to which URL. In fact, it could just use that log to count all hits, cached or not.


Viewing latest article 1
Browse Latest Browse All 2

Trending Articles