特定のhttp_user_agent変数を設定する端末からのアクセスを無条件で許可するためのnginx.confの設定例。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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