Nginx: ngx_http_map_module
ngx_http_map_module Module ngx_http_map_module (nginx.org)
map $http_host $name { hostnames; default 0; ~map\.intrinsic.\w+ 1; *.canto.com 2; aa.intrinsic.io 3; bb.intrinsic.* 4; } map $http_user_agent $mobile { default 0; ~*Chrome 1; } server { listen 80; listen [::]:80; server_name vend.intrinsic.io *.intrinsic.io; root /usr/share/nginx/html; error_log /var/log/nginx/error.log debug; rewrite_log on; location / { return 202 $name:$mobile\n; } error_page 404 /404.html; location = /404.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } }