Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
特定のhttp_user_agent変数を設定する端末からのアクセスを無条件で許可するためのnginx.confの設定例。
http {
(略)
server {
(略)
location /somewhere_to_restrict {
(前略)
if ($http_user_agent ~ WhileMobile) {
return 404;
}
(中略)
if ($allowed = deny) {
return 404;
}
(後略)
}
(略)
}
(略)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment