公開前で認証かけときたいけどOGPのチェックはしたいときに
server {
set $auth "Restricted";
if ($http_user_agent ~ (Twitterbot|facebookexternalhit)) {
set $auth off;
}
location / {
auth_basic $auth;
auth_basic_user_file /etc/nginx/.htpasswd;
}
}
Go to list of users who liked
More than 5 years have passed since last update.
公開前で認証かけときたいけどOGPのチェックはしたいときに
server {
set $auth "Restricted";
if ($http_user_agent ~ (Twitterbot|facebookexternalhit)) {
set $auth off;
}
location / {
auth_basic $auth;
auth_basic_user_file /etc/nginx/.htpasswd;
}
}
Register as a new user and use Qiita more conveniently
Go to list of users who liked