Case-insensitive URL in nginx
<p>I want to be able to access both www.mrmerch.com/TERMS and www.mrmerch.com/terms. I currently have two subfolders set up to accomplish this - TERMS and terms. Inefficient and incorrect, I know.</p>

<p>Here is my current configuration. I added the very last location block, but I still can't hit anything that doesn't exactly match that (e.g., "Terms"). Any help is greatly appreciated. Thanks!</p>

<pre><code>server   {
server_name www.mrmerch.com;
return 301 $scheme://mrmerch.com$request_uri;
}

server {
listen 80 default_server;
server_name mrmerch.com;
server_tokens off;

access_log /var/log/nginx/mrmerch.access_log;
error_log /var/log/nginx/mrmerch.error_log;

root /home/paul/www/mistermerch.com/;
try_files $uri $uri/ /index.php$is_args$args;

gzip on;
gzip_comp_level 6;
gzip_vary on;
gzip_min_length  1000;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_buffers 16 8k;
gzip_disable "MSIE [1-6].";

location = /favicon.ico {
            log_not_found off;
            access_log off;
    }

    location = /robots.txt {
            allow all;
            log_not_found off;
            access_log off;
    }

location /artwork {
    alias /home/mistermerch/www/;
}

location ~ \.php$ {
    try_files   $uri =404;
    fastcgi_pass   127.0.0.1:9000;
    fastcgi_index  index.php;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
    #fastcgi_param  SCRIPT_FILENAME /home/paul/www/mistermerch.com$fastcgi_script_name;
    include fastcgi_params;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
            expires max;
            log_not_found off;
    }


    location ~* ^/Terms/ {
    }



}
</code></pre>