例えばフィーチャーフォン専用のmobile.example.comへリダイレクトするにはこんな感じ。
if ($http_user_agent ~ ^DoCoMo) {
rewrite ^(.*) http://mobile.example.com$1;
}
if ($http_user_agent ~ ^KDDI) {
rewrite ^(.*) http://mobile.example.com$1;
}
if ($http_user_agent ~ ^SoftBank) {
rewrite ^(.*) http://mobile.example.com$1;
}
if ($http_user_agent ~ ^J-PHONE) {
rewrite ^(.*) http://mobile.example.com$1;
}
if ($http_user_agent ~ ^vodafone) {
rewrite ^(.*) http://mobile.example.com$1;
}
if ($http_user_agent ~ ^Up.Browser) {
rewrite ^(.*) http://mobile.example.com$1;
}