直接在站点配置文件里加上下面代码就行 location ~ .*\.(js|css)?$ { expires 12h; error_log off; access_log off; } location / { if (!-e $request_filename) { rewrite ^(.*)$ /index.php?s=/$1 last; break; } }