The cache is dynamically generated. It is more efficient to read these cache files directly through the URL. However, cache letters are all lowercase. For example http://xxx/ooo/abc.jpg
When the user reads http://xxx/ooo/ABC.jpg, the cache cannot be located (error report
How can I ignore the case of files only in the path ooo/?
仅有的幸福2017-05-16 17:30:49
I didn’t even read the question clearly, so I posted a link. Unfortunately, I don’t have enough reputation, otherwise I would definitely step on you
Let me answer the poster’s question, two options:
1. Use the Perl Moudle officially provided by nginx. Note that this module is not automatically loaded. When you need to run the configuration file, add --with-httpperlmodule. First, the location must match the ooo directory, and then match the remaining uri. If there are uppercase letters, call perl to convert all urls to lowercase, and then rewrite, refer to the configuration code:
#测试perl的统一转小写功能
perl_set $url '
sub {
my $r = shift;
my $lurl = lc($r->uri);
return $lurl;
}
';
location ~* ^/ooo/ {
if ($uri ~ [A-Z]) {
rewrite ^(.*)$ $url premanent;
}
root ooo所在的根目录;
}
伊谢尔伦2017-05-16 17:30:49
You can use lua, perl for processing, or you can write modules for processing. It has been given above, so I won’t repeat it.