| 1 | events { }
|
|---|
| 2 | http {
|
|---|
| 3 | proxy_cache_path /tmp/nginx-cache-other levels=1:2 keys_zone=other_cache:1m inactive=1w;
|
|---|
| 4 | server {
|
|---|
| 5 | listen 80;
|
|---|
| 6 | location /test {
|
|---|
| 7 | add_header Vary $http_returnvary;
|
|---|
| 8 | add_header Xtra $http_xtra;
|
|---|
| 9 | return 200 'Vary=$http_returnvary\nXtra=$http_xtra\n-----\n\n';
|
|---|
| 10 | }
|
|---|
| 11 | location / {
|
|---|
| 12 | add_header X-Cache "$upstream_cache_status $uri$is_args$args" always;
|
|---|
| 13 | proxy_cache other_cache;
|
|---|
| 14 | proxy_cache_min_uses 1;
|
|---|
| 15 | proxy_cache_key "$uri$is_args$args";
|
|---|
| 16 | proxy_cache_valid any 5s;
|
|---|
| 17 | proxy_pass http://127.0.0.1:80/test;
|
|---|
| 18 | }
|
|---|
| 19 | }
|
|---|
| 20 | }
|
|---|