HTTP Auth With Docker
I have started a docker instance on Linode which can be accessed with its public IP:Port. However, I need HTTP Auth implemented so that anyone who visits the IP:Port is prompted for a username and password. How can I achieve this?
1 Reply
The process for enabling HTTP Auth is a bit different when the application is running through a container. Take a look at this post on StackOverflow about Securing a Docker Container with HTTP Basic Auth. It looks like this can be done by setting up an NGINX container instance and using it as a reverse proxy to your application.
This guide for Securing Docker with HTTP Basic Authentication provides instructions on how this can be done. If you are interested in setting up something that may be a bit more secure then you may want to look into Protecting the Docker Daemon Socket.
--Kevin