diff --git a/reverse_proxy.conf b/reverse_proxy.conf index c95761437b8c724000acf85e04d6b3b1350d669b..7a3221e1a36d5f5398f7fc3fdddb37133aafa6fd 100644 --- a/reverse_proxy.conf +++ b/reverse_proxy.conf @@ -1,3 +1,6 @@ +proxy_cache_path /tmp/cache keys_zone=mycache:10m levels=1:2 inactive=30m +max_size=100m; + server { listen 52894; listen [::]:52894; @@ -9,4 +12,13 @@ server { location ~ /read/([0-9]*) { proxy_pass http://0.0.0.0:32894/read/$1; } + + location ~ /read/([0-9]*)/([0-9]*) { + proxy_cache mycache; + proxy_cache_valid 30m; + proxy_cache_key "$1$2"; + add_header X-Proxy-Cache $upstream_cache_status; + + proxy_pass http://0.0.0.0:32894/read/$1; + } } \ No newline at end of file