nginx忽略文件名大小写
生活随笔
收集整理的這篇文章主要介紹了
nginx忽略文件名大小写
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
nginx編譯的時候注意: ./configure --user=xafcawe --group=xafcawe --prefix=/usr/local/webserver/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_perl_module [root@xakc vhosts]# cat img.qq.com.conf?
perl_set $url '
sub {
my $r = shift;
return $1.lc($2) if ($r->uri =~ m/^(.+\/)([^\/]+)$/);
}
';
server
? {
??? listen?????? 80;
??? server_name? img.qq.com;
??? #index index.html index.htm;
??? root /data1/website/img;
??? if ($uri ~ [A-Z]){
??? rewrite ^(.*)$ $url last;
??? }
??? location ~ ^/bbs/.*\.(php|php5)$???
???? {
????? deny all;
????? }?? 粗體部分為添加的支持內容 即可忽略文件名大小寫。 http://img.qq.com/ha/UploadP/2010-5/201051414454943944_D.jpg 201051414454943944_d.jpg 這個是真實存在的小寫的文件。
本文轉自 liang3391 51CTO博客,原文鏈接:http://blog.51cto.com/liang3391/577547
perl_set $url '
sub {
my $r = shift;
return $1.lc($2) if ($r->uri =~ m/^(.+\/)([^\/]+)$/);
}
';
server
? {
??? listen?????? 80;
??? server_name? img.qq.com;
??? #index index.html index.htm;
??? root /data1/website/img;
??? if ($uri ~ [A-Z]){
??? rewrite ^(.*)$ $url last;
??? }
??? location ~ ^/bbs/.*\.(php|php5)$???
???? {
????? deny all;
????? }?? 粗體部分為添加的支持內容 即可忽略文件名大小寫。 http://img.qq.com/ha/UploadP/2010-5/201051414454943944_D.jpg 201051414454943944_d.jpg 這個是真實存在的小寫的文件。
本文轉自 liang3391 51CTO博客,原文鏈接:http://blog.51cto.com/liang3391/577547
總結
以上是生活随笔為你收集整理的nginx忽略文件名大小写的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: CMD-echo
- 下一篇: 云计算已在大数据分析中发挥重要作用