Lowercase URLs

Hi,

I would like to know how to convert the URLs to lowercase. When somebody
hits an URL ( irrespective of the case ), it should be converted to
lowercase in the address bar.

Posted at Nginx Forum:

On 2012-08-28 11:30, ShreyasPrakash wrote:

Hi,

I would like to know how to convert the URLs to lowercase. When
somebody
hits an URL ( irrespective of the case ), it should be converted to
lowercase in the address bar.

With the help of lua-nginx-module (see
GitHub - openresty/lua-nginx-module: Embed the Power of Lua into NGINX HTTP servers)
it could look like this …

location ~ “\p{Lu}” {
rewrite_by_lua ‘return ngx.redirect(string.lower(ngx.var.uri),
ngx.HTTP_MOVED_PERMANENTLY)’;
}

-cs

Can’t we get this functionality without using lua-nginx-module?

Posted at Nginx Forum:

On 2012-08-29 13:11, ShreyasPrakash wrote:

Can’t we get this functionality without using lua-nginx-module?

AFAIK Nginx does support this out of the box, i.e. there’s nothing like
the internal functions tolower/toupper of RewriteMap in Apache HTTP (see
mod_rewrite - Apache HTTP Server Version 2.4). If
you prefer Perl over Lua, go with the Perl module.