Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sadnessOjisan committed May 8, 2024
1 parent 52a3dbe commit abfba12
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/contents/20240508-docker-swagger-ui/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,6 @@ sleep 5 && nginx -s reload &
htpasswdは Apache のためのようにも思えますが、Nginx も auth_basic_user_file で htpasswd を指定するとBasic認証ができます。
そのため htpasswd を作り、それをコンテナ立ち上げ時にdefault設定されているNginxの設定に対して htpasswd を使うように書き換えます。
そうすることで Basic 認証が実現できます。
上の設定では、usernameをhoge, passwordをfugafugaでログインできます。

このやり方は https://github.com/ravindu1024/swagger-ui-basic-auth/blob/master/Dockerfile にある Dockerfile を参考にしました。

0 comments on commit abfba12

Please sign in to comment.