Welcome! Log In Create A New Profile

Advanced

Re: Mapping to change URL

Sergey A. Osokin
October 28, 2021 05:32AM
Hi Tony,

hope you're doing well.

On Thu, Oct 28, 2021 at 08:22:53AM +0000, tony tabone wrote:
>
> I am trying to add a mapping to change the url being shown with every location. Do you know if this is possible since an error is being encountered on the mapping.
>
> map $geoip2_data_country_code $leovegas_com_index_file $request_uri $new {
> default /index-en.html default 0;
> MT /en-desktop.html ~^/tony/ maintenance.tony;
> }

According to the http_map module's documentation the map directive creates
a new variable whose value depends on values of one or more of the source
variables specified in the first parameter
http://nginx.org/en/docs/http/ngx_http_map_module.html#map

In other words, the map directive expects only two variables: a source
and a destination.

> nginx: [emerg] invalid number of arguments in "map" directive in /etc/nginx/nginx.conf:91

When nginx starts, it validates its configuration file and fails on
incorrect usage of a directive.

It seems like at least more than one map directive (probably two or three)
need to be added to resolve the problem.

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

Mapping to change URL

tony tabone October 28, 2021 04:24AM

Re: Mapping to change URL

Sergey A. Osokin October 28, 2021 05:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 48
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready