Nginx 不区分大小写

时间:2021-03-28 00:48:39

location ~* .*\.(gif|jpg|jpeg|bmp|png|tiff|tif|ico|wmf|js)$ {
       #         slowfs_cache    fastcache;
       #         slowfs_cache_key        $uri;
       #         slowfs_cache_valid      1d;
       #         add_header X-Cache      '$slowfs_cache_status from $host';
                expires 1h;
        }

        location / {
        if ($uri ~ [A-Z]) {
        rewrite_by_lua 'return ngx.redirect(string.lower(ngx.var.uri),ngx.HTTP_MOVED_PERMANENTLY)';}
                root $SROOT;
                index   index.html index.php index.htm;
        }