我遇到了一点问题。我需要为文件夹提供不区分大小写的文件,我使用 nginx:
原来的: https://example.com/media/catalog/product/b/t/bt2501_brandy.jpg https://example.com/media/catalog/product/p/r/PR3027GUN_1.JPG
上面的图片可以用这种方式工作(不区分大小写): https://example.com/media/catalog/product/b/t/BT2501_BRANDY.jpg或者 https://example.com/media/catalog/product/b/t/bt2501_Brandy.jpg或者 https://example.com/media/catalog/product/b/t/bt2501_Brandy.JPG https://example.com/media/catalog/product/p/r/pr3027gun_1.JPG
给我一些想法吗?
我知道 Linux 区分大小写。但我可以用 nginx 来解决这个问题吗?
谢谢
答案1
location ~* ^/media/catalog/product/ {
# The tilde and asterisks ensure that this location will
# be matched case insensitive. nginx does not support
# setting absolutely everything to be case insensitive.
# The reason is easy, it's costly in terms of performance.
}