@@ -123,7 +123,7 @@ Sample configuration (same location syntax)
123123 location / {
124124 proxy_pass http://127.0.0.1:8000;
125125 proxy_cache tmpcache;
126- proxy_cache_key $uri$is_args$args;
126+ proxy_cache_key " $uri$is_args$args" ;
127127 proxy_cache_purge PURGE from 127.0.0.1;
128128 }
129129 }
@@ -139,7 +139,7 @@ Sample configuration (same location syntax - purge all cached files)
139139 location / {
140140 proxy_pass http://127.0.0.1:8000;
141141 proxy_cache tmpcache;
142- proxy_cache_key $uri$is_args$args;
142+ proxy_cache_key " $uri$is_args$args" ;
143143 proxy_cache_purge PURGE purge_all from 127.0.0.1;
144144 }
145145 }
@@ -155,13 +155,14 @@ Sample configuration (separate location syntax)
155155 location / {
156156 proxy_pass http://127.0.0.1:8000;
157157 proxy_cache tmpcache;
158- proxy_cache_key $uri$is_args$args;
158+ proxy_cache_key " $uri$is_args$args" ;
159159 }
160160
161161 location ~ /purge(/.*) {
162162 allow 127.0.0.1;
163163 deny all;
164- proxy_cache_purge tmpcache $1$is_args$args;
164+ proxy_cache tmpcache;
165+ proxy_cache_key "$1$is_args$args";
165166 }
166167 }
167168 }
@@ -180,20 +181,23 @@ Sample configuration (Optional)
180181 location / { #json
181182 proxy_pass http://127.0.0.1:8000;
182183 proxy_cache tmpcache;
183- proxy_cache_key $uri$is_args$args;
184+ proxy_cache_key " $uri$is_args$args" ;
184185 }
185186
186187 location ~ /purge(/.*) { #xml
187188 allow 127.0.0.1;
188189 deny all;
189- proxy_cache_purge tmpcache $1$is_args$args;
190+ proxy_cache tmpcache;
191+ proxy_cache_key "$1$is_args$args";
190192 cache_purge_response_type xml;
191193 }
192194
193195 location ~ /purge2(/.*) { # json
194196 allow 127.0.0.1;
195197 deny all;
196- proxy_cache_purge tmpcache $1$is_args$args;
198+ proxy_cache tmpcache;
199+ proxy_cache_key "$1$is_args$args";
200+ cache_purge_response_type json;
197201 }
198202 }
199203
@@ -202,19 +206,21 @@ Sample configuration (Optional)
202206 location / { #text
203207 proxy_pass http://127.0.0.1:8000;
204208 proxy_cache tmpcache;
205- proxy_cache_key $uri$is_args$args;
209+ proxy_cache_key " $uri$is_args$args" ;
206210 }
207211
208212 location ~ /purge(/.*) { #text
209213 allow 127.0.0.1;
210214 deny all;
211- proxy_cache_purge tmpcache $1$is_args$args;
215+ proxy_cache tmpcache;
216+ proxy_cache_key "$1$is_args$args";
212217 }
213218
214219 location ~ /purge2(/.*) { #html
215220 allow 127.0.0.1;
216221 deny all;
217- proxy_cache_purge tmpcache $1$is_args$args;
222+ proxy_cache tmpcache;
223+ proxy_cache_key "$1$is_args$args";
218224 cache_purge_response_type html;
219225 }
220226 }
0 commit comments