🗂️ 实践出真知 🏷️ #服务器 #Nginx Nginx配置浏览器缓存 通过expires指令,将指定后缀的请求设置缓存。 123456789101112131415161718192021upstream localblog { server 192.168.0.108:4000;}server { listen 80; server_name 192.168.0.108; client_max_body_size 1000M; sendfile on; location / { #root /opt/dist; proxy_pass http://localblog; index index.html; if ($request_filename ~* ^.*?\.(ico|jpg|jpeg|gif|png|woff|woff2|bmp|js|css)$) { expires 1d; } }} 可参考知识点 Last-Modified/If-Modified-Since Etag/If-None-Match Cache-Control: max-age和expires Expires Nginx配置浏览器缓存 http://www.tung7.com/实践出真知/Nginx配置浏览器缓存.html Author Tung7 Posted on September 3, 2016 Licensed under