How to make URL case insensitive with Nginx

后端 未结 1 1937
执念已碎
执念已碎 2020-12-31 02:15

I am using Nginx for a simple demo website, and I just configure the Nginx like this:

server {
    listen          80;
    server_name     www.abc.com;

             


        
1条回答
  •  难免孤独
    2020-12-31 02:36

    server {
        # Default, you don't need this!
        #listen          80;
    
        server_name     www.abc.com;
    
        # Index and root are global configurations for the whole server.
        index           index.html;
        root            /home/www.abc.com/;
    
        location / {
            location ~* ^/sub/ {
                # 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.
            }
        }
    }
    

    0 讨论(0)
提交回复
热议问题