map directive doubt

Francis Daly francis at daoine.org
Thu Mar 9 22:50:25 UTC 2017


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 at daoine.org


More information about the nginx mailing list