nginx 二级目录高级写法

nginx二级目录高级配置:

location ~ .*.(html)$ {
        expires 1m;
        error_page 404 = /test/index.html;
        access_log  /data/log/test.access.log main;
}
location ~ .*.(js|css|gif|jpg|jpeg|png|bmp|swf|svg|ico|wav|mp3|txt|WAV|json)?$ {
        expires 1m;
        error_page 404 = /test/index.html;
}

location ~ .*.(html)$ {
        expires 1m;
        error_page 404 = /test/index.html;
        access_log  /data/log/test.access.log main;
}
location ~ .*.(js|css|gif|jpg|jpeg|png|bmp|swf|svg|ico|wav|mp3|txt|WAV|json)?$ {
        expires 1m;
        error_page 404 = /test1/index.html;
}
原文地址:https://www.cnblogs.com/ipyanthony/p/12012190.html