一切似乎都是正确的。但是不会发生缓存文件。不缓存。 /var/cache/nginx/mariasd.tk_proxy文件夹已创建,但是其中没有文件。 X缓存状态:MISS
proxy_cache_path /var/cache/nginx/mariasd.tk_proxy levels=1:2 keys_zone=mariasd.tk_proxy:5m max_size=1073741824;
proxy_buffering on;
server
{
add_header X-Cache-Status $upstream_cache_status;
set $no_cache "";
set $cache_cookie $http_cookie;
if ($cache_cookie !~ "^\s*$") {
set $no_cache 1;
}
listen 127.0.0.1:80;
server_name mariasd.tk www.mariasd.tk ;
access_log /var/log/nginx/domains/mariasd.tk.log;
access_log /var/log/nginx/domains/mariasd.tk.bytes bytes;
error_log /var/log/nginx/domains/mariasd.tk.error.log;
root /home/kartaltk/domains/mariasd.tk/public_html;
index index.php index.html index.htm;
if ($http_x_forwarded_proto != 'https') {
return 301 https://$host$request_uri;
}
include /usr/local/directadmin/data/users/mariasdtk/nginx_php.conf;
location /
{
proxy_cache_key "$scheme$request_method$host$request_uri";
#proxy_no_cache $no_cache;
#proxy_cache_bypass $no_cache;
proxy_cache mariasd.tk_proxy;
proxy_cache_valid 200 10m;
proxy_cache_use_stale updating;
proxy_cache_background_update on;
# access_log off;
proxy_buffering on;
proxy_pass http://127.0.0.1:8080;