nginx

概要

nginxの設定ファイルにBasic認証の記述例です。

記述例

# cd /var/www/html
# mkdir pw
# htpasswd -c .htpasswd hogehogeuser
パスワード 2回入力
# vi /etc/nginx/stie-enabled/inamuu.com.conf
location /phpMyAdmin {
             alias /var/www/html/phpMyAdmin/;
             auth_basic "This is Secret Aria";
             auth_basic_user_file /var/www/html/pw/.htpasswd;
             }
# service nginx configtest
# service nginx reload

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2022-06-30 (木) 01:40:11