@@ -7,10 +7,10 @@ Below you will find detailed NGINX configuration recommendations for the
7
7
features provided by this library. The examples are tested with NGINX version
8
8
1.4.6.
9
9
10
- NGINX cache is a set of key/value pairs. The key is built with elements taken from the requests
10
+ NGINX cache is a set of key/value pairs. The key is built with elements taken from the requests
11
11
(URI, cookies, http headers etc) as specified by `proxy_cache_key ` directive.
12
12
13
- When we interact with the cache to purge/refresh entries we must send to NGINX a request which has
13
+ When we interact with the cache to purge/refresh entries we must send to NGINX a request which has
14
14
the very same values, for the elements used for building the key, as the request that create the entry.
15
15
In this way NGINX can build the correct key and apply the required operation to the entry.
16
16
@@ -20,8 +20,8 @@ you can use in the key see `this page from the official documentation <http://ng
20
20
Purge
21
21
~~~~~
22
22
23
- NGINX does not support :term: `purge ` functionality out of the box but you can easily add it with
24
- `ngx_cache_purge <https://github.com/FRiCKLE/ngx_cache_purge >`_ module. You just need to compile
23
+ NGINX does not support :term: `purge ` functionality out of the box but you can easily add it with
24
+ `ngx_cache_purge <https://github.com/FRiCKLE/ngx_cache_purge >`_ module. You just need to compile
25
25
NGINX from sources adding `ngx_cache_purge ` with `--add-module `
26
26
27
27
You can check the script :source: `install-nginx.sh <tests/install-nginx.sh> ` to get an idea
@@ -50,3 +50,14 @@ so add a line like the following to your config:
50
50
:language: nginx
51
51
:lines: 44
52
52
53
+ .. _nginx_debugging :
54
+
55
+ Debugging
56
+ ~~~~~~~~~
57
+
58
+ Configure your Nginx to set a custom header (`X-Cache `) that shows whether a
59
+ cache hit or miss occurred:
60
+
61
+ .. code-block :: none
62
+
63
+ add_header X-Cache $upstream_cache_status;
0 commit comments