Commit 95caf079 authored by Cédric F.'s avatar Cédric F.

Cache RPC responses for 60 seconds

parent 453122be
......@@ -18,6 +18,8 @@ http {
include /etc/nginx/mime.types;
proxy_cache_path nginx/cache/rpc levels=1:2 keys_zone=rpc:10m max_size=10g inactive=365d use_temp_path=off;
limit_req_zone $binary_remote_addr zone=default:10m rate=5r/s;
server {
......@@ -75,6 +77,15 @@ http {
proxy_set_header Authorization "Basic SWp4enNybXNybHFoZGRna2ZqNTVmZ2tjZU1jc3Rzb2F6aWthc2VzdWM6c3RhMmJqYmZ5cWN0eXRxdWpvbGNhdGJ2dmtzanVsclVxcnpjNnd1TWM=";
proxy_set_header Host $host;
proxy_cache rpc;
proxy_cache_key $request_body;
proxy_cache_methods GET HEAD POST;
proxy_cache_valid any 60s;
proxy_cache_use_stale error timeout;
add_header X-Cache-Status $upstream_cache_status;
proxy_pass https://localhost:9109;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment