Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
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