只需一步,快速开始
proxy_cache_path /usr/local/nginx/caches/moec.top levels=1:2 keys_zone=laoxong:50m inactive=30m max_size=50m; server { listen 80; listen 443 ssl http2; ssl_certificate /usr/local/nginx/conf/ssl/moec.crt; ssl_certificate_key /usr/local/nginx/conf/ssl/moec.key; ssl_session_timeout 1d; ssl_session_cache builtin:1000 shared:SSL:10m; add_header Strict-Transport-Security "max-age=63072000; includeSubdomains; preload"; ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3; ssl_ciphers "TLS-CHACHA20-POLY1305-SHA256:TLS-AES-256-GCM-SHA384:TLS-AES-128-GCM-SHA256:EECDH+CHACHA20:EECDH+CHACHA20-draft:EECDH+ECDSA+AES128:EECDH+aRSA+AES128:RSA+AES128:EECDH+ECDSA+AES256:EECDH+aRSA+AES256:RSA+AES256:EECDH+ECDSA+3DES:EECDH+aRSA+3DES:RSA+3DES:!MD5"; ssl_prefer_server_ciphers on; ssl_stapling on; ssl_stapling_verify on; server_name 你的域名; access_log /usr/local/nginx/caches/moec.top_nginx.log combined; charset utf-8,gbk; location / { proxy_set_header Accept-Encoding ""; proxy_pass https://你的网站; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_cache laoxong; proxy_cache_key $uri$is_args$args; proxy_cache_valid 200 304 30m; proxy_cache_valid 301 24h; proxy_cache_valid 500 502 503 504 0s; proxy_cache_valid any 1s; proxy_cache_min_uses 1; expires 12h; } location ~ /purge(/.*) { allow all; allow 127.0.0.1; # deny all; proxy_cache_purge laoxong $1$is_args$args; } }
<script> $(document).ready(function(){ $("#submit").click(function(){ var uri = "https://域名/purge" + window.location.pathname; $.get(uri,function(data,status){ return true; }); }); }); </script>
举报
mryin 发表于 2020-2-13 20:14 学习了,写的很认真
cquyf 发表于 2020-2-13 20:53 大佬,解决下自己更像缓存的问题啊
本版积分规则 发表回复 回帖后跳转到最后一页
Archiver|手机版|小黑屋|全球主机交流论坛
GMT+8, 2024-5-16 22:19 , Processed in 0.079706 second(s), 9 queries , Gzip On, MemCache On.
Powered by Discuz! X3.4
© 2001-2023 Discuz! Team.