cityofcapetown / docker_wui

Minimalist, Nginx-based image for serving up content. Intention is for it to be used to serve up static web content.
MIT License
0 stars 0 forks source link

Add optional simple NGINX password #2

Closed riazarbi closed 4 years ago

riazarbi commented 5 years ago

One can add simple HTTP password protection to NGINX.

Add an environmental variable to set the password. -e PASSWORD=<password> along with a sed to inject into NGINX conf file at runtime.

Mucho convenient for ad-hoc tools that are restricted or confidential.

Bonus points if we include a little utility that can change the password with a docker exec -it <container-name> new_password "NEW_PASSWORD" for password rotation.

Literature : see -

https://www.digitalocean.com/community/tutorials/how-to-set-up-basic-http-authentication-with-nginx-on-ubuntu-14-04

riazarbi commented 4 years ago

Done