1. 설치
htpasswd -c /tmp/.htpasswd test01
2. nginx 설정
server {
listen 80;
server_name secure.test.co.kr;
access_log /var/log/nginx/secure-access.log combined;
location = /favicon.ico { access_log off; log_not_found off; }
location / {
auth_basic "Restricted Area";
auth_basic_user_file /tmp/.htpasswd;
root /var/www/html;
index index.html index.htm;
}
}
'오픈소스 > nginx' 카테고리의 다른 글
nginx add header (0) | 2018.02.06 |
---|---|
nginx bandwidth limit (0) | 2018.02.06 |
nginx tcp/application load balancing (0) | 2018.02.05 |
nginx load balancing (0) | 2018.02.05 |
nginx 접속 제한 (rate limiting) (0) | 2018.02.05 |