Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pandanote-info/b157fe9595d667908e206b7c17e8f4e5 to your computer and use it in GitHub Desktop.
Save pandanote-info/b157fe9595d667908e206b7c17e8f4e5 to your computer and use it in GitHub Desktop.
特定の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