#启用反向代理缓存模板 server { listen 80; listen [::]:80; server_name {$server_name}; index {$index}; location / { default_type text/html; proxy_cache hyproxy; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host {$header_host}; proxy_pass {$proxy_pass}; if ($http_Cache_Control = "no-cache") { rewrite ^(.*)$ /purge$1 last; } } location ~ /purge(/.*){ proxy_cache_purge hyproxy $scheme://$host$1$is_args$args; } access_log {$access_log_path} combined; #access_log end error_log {$error_log_path} crit; #error_log end }