Sign inSign up

ovalmoney/nginx-auth-proxy

By ovalmoney

•Updated almost 9 years ago

Simple HTTP Proxy with Basic Authentication

Image
0

1.5K

ovalmoney/nginx-auth-proxy repository overview

⁠Docker image of Nginx Proxy with Basic Auth

Docker Automated build Docker Pulls Docker Build Status

Simple HTTP Proxy with Basic Authentication

       w/ user:pass   +------------------------+      +-------------+
User ---------------> | nginx-basic-auth-proxy | ---> | HTTP Server |
                      +------------------------+      +-------------+

⁠Run

$ docker run \
    --rm \
    --name nginx-basic-auth-proxy \
    -p 8080:80 \
    -p 8090:8090 \
    -e BASIC_AUTH_USERNAME=username \
    -e BASIC_AUTH_PASSWORD=password \
    -e PROXY_PASS=https://www.google.com \
    -e SERVER_NAME=proxy.dtan4.net \
    -e PORT=80 \
    ovalmoney/nginx-auth-proxy

Access to http://localhost:8080⁠ , then browser asks you username and password.

You can also try complete HTTP-proxy example using Docker Compose. hello-world web application cannot be accessed without authentication.

$ docker-compose up
# http://localhost:8080/
# - Username: username
# - Password: password

⁠Environment variables

⁠Required
KeyDescription
BASIC_AUTH_USERNAMEBasic auth username
BASIC_AUTH_PASSWORDBasic auth password
PROXY_PASSProxy destination URL
⁠Optional
KeyDescriptionDefault
SERVER_NAMEValue for server_name directiveexample.com
PORTValue for listen directive80
CLIENT_MAX_BODY_SIZEValue for client_max_body_size directive1m
PROXY_READ_TIMEOUTValue for proxy_read_timeout directive60s
WORKER_PROCESSESValue for worker_processes directiveauto

⁠License

MIT License

Tag summary

Content type

Image

Digest

Size

8 MB

Last updated

almost 9 years ago

docker pull ovalmoney/nginx-auth-proxy