Lightweight nginx reverse proxy with HTTP basic authentication for securing Docker containers and web applications. WebSocket upgrade requests are forwarded, so applications such as Apache Flink's web UI can run behind the proxy.
docker run -d --name web dockercloud/hello-world
docker run -d -p 80:80 --link web:web --name auth beevelop/nginx-basic-authTry accessing and logging in with username foo and password bar.
docker run -d \
-e HTPASSWD='foo:$apr1$odHl5EJN$KbxMfo86Qdve2FH4owePn.' \
-e FORWARD_PORT=1337 \
--link web:web -p 8080:80 \
--name auth \
beevelop/nginx-basic-authUse single quotes to prevent unwanted interpretation of
$signs!
HTPASSWD(default:foo:$apr1$odHl5EJN$KbxMfo86Qdve2FH4owePn.): Will be written to the .htpasswd file on launch (non-persistent)FORWARD_PORT(default:80): Port of the source container that should be forwardedFORWARD_HOST(default:web): Hostname of the source container that should be forwardedCLIENT_MAX_BODY_SIZE(default:1g): Maximum accepted request body sizeLIMIT_CONN(default:20): Maximum concurrent connections per client IPLIMIT_RATE(default:0): Response rate limit per request;0disables rate limitingNGINX_WORKER_PROCESSES(default:1): Number of nginx worker processesThe container does not need any volumes to be mounted! Nonetheless you will find all interesting files at
/etc/nginx/*.
Multiple Users are possible by separating the users by newline. To pass the newlines properly you need to use Shell Quoting (like $'foo\nbar'):
docker run -d --link web:web --name auth \
-e HTPASSWD=$'foo:$apr1$odHl5EJN$KbxMfo86Qdve2FH4owePn.\ntest:$apr1$LKkW8P4Y$P1X/r2YyaexhVL1LzZAQm.' \
beevelop/nginx-basic-auth
results in 2 users (foo:bar and test:test).
Error: nginx: [emerg] host not found in upstream "web"
- Ensure you link the container as
webusing--link foobar:web
- SSL/HTTPS is not currently supported
- For SSL requirements, consider using
jwilder/nginx-proxyas a central gateway withVIRTUAL_HOSTenvironment variable
| Badge | Pulls | Build Status | Release Date | Release |
|---|---|---|---|---|

