# 主 location 块用于处理 PHP 文件 location / { try_files $uri $uri/ /index.php?$args; } # 为特定静态资源设置缓存策略 location ~* \.(js|ttf|css|woff|otf|woff2|png|gif|jpeg|jpg|ico)$ { try_files $uri $uri/ /index.php$is_args$args; add_header Cache-Control "public, max-age=86400"; access_log off; expires 24h; }