How to make URL case insensitive with Nginx -
i using nginx simple demo website, , configure nginx this:
server { listen 80; server_name www.abc.com; location / { index index.html; root /home/www.abc.com/; } } in www.abc.com folder, have sub-folder named sub, , inside has index.html file. when try visit www.abc.com/sub/index.html, works fine. if visit www.abc.com/sub/index.html, returns 404.
how configure nginx case-insensitive in url?
server { # default, don't need this! #listen 80; server_name www.abc.com; # index , root global configurations whole server. index index.html; root /home/www.abc.com/; location / { location ~* ^/sub/ { # tilde , asterisks ensure location # matched case insensitive. nginx not support # setting absolutely case insensitive. # reason easy, it's costly in terms of performance. } } }
Comments
Post a Comment