Welcome! Log In Create A New Profile

Advanced

Re: map directive doubt

Francis Daly
March 09, 2017 05:52PM
On Thu, Mar 09, 2017 at 11:01:38AM +0530, Anoop Alias wrote:

Hi there,

> Just have a doubt in map directive
>
> map $http_user_agent $upstreamname {
> default desktop;
> ~(iPhone|Android) mobile;
> }
>
> is correct ?

That doesn't look too hard to test.

==
server {
listen 8880;
return 200 "user agent = $http_user_agent; map = $upstreamname\n";
}
==

$ curl -H User-Agent:xxAndroidxx http://localhost:8880/x

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Re: map directive doubt

Francis Daly March 09, 2017 05:52PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 216
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