Welcome! Log In Create A New Profile

Advanced

Re: what is my syntax error

Sergey A. Osokin
March 07, 2024 03:40PM
On Thu, Mar 07, 2024 at 03:20:23PM -0500, Victor Oppenheimer wrote:
> In my nginx.conf file on my Windows computerI have the following code in
> nginx.conf.
>
> http { # http context specific to HTTP affecting all virtual servers
>
> # force incoming URLs to lower case
>     map $uri $lowercase {~ ^(.+)$ /$1};

You may need to remove space after tilde symbol, after that
everything works as expected:

map $uri $lowercase {
~^(.+)$ /$1;
}

server {
listen 80;
location / {
return 200 "lowercase=$lowercase\n";
}
}

Test:

% curl 127.1:80/foobar
lowercase=//foobar


--
Sergey A. Osokin
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

what is my syntax error

Victor Oppenheimer March 07, 2024 03:22PM

Re: what is my syntax error

Sergey A. Osokin March 07, 2024 03:40PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 212
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready