beevelop/docker-nginx-basic-auth
关于
:closed_lock_with_key: Simple Docker image for basic authentication
系统与基础设施实测星标增长
- 24小时
- 0
- 7天
- 正在收集历史
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Nginx Basic Auth proxy
Protect an HTTP service behind nginx with HTTP Basic authentication. This image uses the full nginx 1.31.10 Alpine base and listens on container port 80.
Quickstart
Run the proxy and an example upstream on the same Docker network.
docker network create nginx-auth-demo
docker run -d --network nginx-auth-demo --name web nginx:alpine
docker run -d --network nginx-auth-demo --name auth \
-p 127.0.0.1:8080:80 beevelop/nginx-basic-auth
curl -u foo:bar http://127.0.0.1:8080/
The example credentials are foo and bar. Supply your own password records with HTPASSWD when deploying the proxy. The existing Compose and Swarm example can also run the demo.
Configuration
| Variable | Default | Description |
|---|---|---|
HTPASSWD |
foo / bar |
Inline htpasswd records separated by newlines. Single-quote literal records to preserve dollar signs in hashes. |
FORWARD_HOST |
web |
Upstream address reachable from the container. |
FORWARD_PORT |
80 |
Upstream HTTP port. |
For a custom login, create an htpasswd file with a tool such as htpasswd -cB users.htpasswd alice, then pass its contents as -e HTPASSWD="$(cat users.htpasswd)" when creating the container. One record per line enables multiple users. Compose YAML requires literal dollar signs in inline hashes to be escaped as $$.
The proxy forwards the client's Authorization header to the upstream after successful authentication. The launcher renders the templates from /opt into /etc/nginx on startup.
Build and test
docker build -t nginx-basic-auth:local .
bash .github/scripts/smoke.sh nginx-basic-auth:local
Pull requests exercise the existing proxy contract and build all seven supported platforms. Scheduled builds refresh latest and nightly daily at 10:00 UTC. Branch pushes, version tags, and manual runs can publish as before. Use a release tag or digest when you need to pin a deployment.
All Docker images
| Badge | Docker Hub | Build Status | Published | Release / Tag | License |
|---|---|---|---|---|---|
Use tags where possible, because

探索相关项目
加载中…