nginx 动静分离 排除部分目录静态页面
如以下的配置是 所有静态页面都到/my/web/item/m路径下,排除ueditor编辑器的html路径
location ~ /ueditor/.*\.(html)$ #需要排除的路径放在这里,不然走下面的html 404找不到路径
{
root /my/web/item;
}
location ~* \.(html)$ { #访问静态页面
expires 30d; #缓存30天
root /my/web/item/m;
}
注意事项:
排除的放上面,优先级高。