basicauth-reverseproxy

command module
v1.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 14, 2019 License: MIT Imports: 13 Imported by: 0

README

Reverse proxy w/ basic authentication

circleci status

pottava/proxy

Supported tags and respective Dockerfile links:
・latest (prod/Dockerfile)
・1.1 (prod/Dockerfile)
・1 (prod/Dockerfile)

Description

This is a reverse proxy, which is able to provide basic authentication as well.
(日本語はこちら)

Usage

1. Set environment variables
Environment Variables Description Required
PROXY_PATTERNS Both virtual host & virtual path can be specified. * (or PROXY_URL)
PROXY_URL The URL to be proxied with this app. * (or PROXY_PATTERNS)
BASIC_AUTH_USER User for basic authentication.
BASIC_AUTH_PASS Password for basic authentication.
APP_PORT The port number to be assigned for listening.
SSL_CERT_PATH TLS: cert.pem file path.
SSL_KEY_PATH TLS: key.pem file path.
CORS_ALLOW_ORIGIN CORS: a URI that may access the resource.
CORS_ALLOW_METHODS CORS: Comma-delimited list of the allowed HTTP request methods.
CORS_ALLOW_HEADERS CORS: Comma-delimited list of the supported request headers.
CORS_MAX_AGE CORS: Maximum number of seconds the results of a preflight request can be cached.
ACCESS_LOG Send access logs to /dev/stdout. (default: false)
CONTENT_ENCODING Compress response data if the request allows. (default: false)
HEALTHCHECK_PATH If it's specified, the path always returns 200 OK
USE_X_FORWARDED_HOST Set original host to X-Forwarded-Host. (default: true)
2. Run the application

$ docker run -d -p 8080:80 -e PROXY_URL pottava/proxy

  • with basic auth:

$ docker run -d -p 8080:80 -e PROXY_URL -e BASIC_AUTH_USER -e BASIC_AUTH_PASS pottava/proxy

  • with TLS:

$ docker run -d -p 8080:80 -e PROXY_URL -e SSL_CERT_PATH -e SSL_KEY_PATH pottava/proxy

  • with CORS:

$ docker run -d -p 8080:80 -e PROXY_URL -e CORS_ALLOW_ORIGIN -e CORS_ALLOW_METHODS -e CORS_ALLOW_HEADERS -e CORS_MAX_AGE pottava/proxy

  • with virtual hosts:

$ export PROXY_PATTERNS="/static=http://assets.cdn/,*.example.com=http://app.io/,*=http://sorry.com/"
$ docker run -d -p 8080:80 -e PROXY_PATTERNS pottava/proxy

  • with docker-compose.yml:
proxy:
  image: pottava/proxy
  ports:
    - 80:80
  links:
    - web
  environment:
    - PROXY_URL=http://web/
    - BASIC_AUTH_USER=admin
    - BASIC_AUTH_PASS=password
    - ACCESS_LOG=true
  container_name: proxy
  • with docker-compose.yml (virtual hosts & SSL/TLS):
proxy:
  image: pottava/proxy
  ports:
    - 443:80
  links:
    - web
  environment:
    - PROXY_PATTERNS="/static=http://assets.cdn/,*.example.com=http://app.io/,*=http://sorry.com/"
    - SSL_CERT_PATH=/etc/certs/cert.pem
    - SSL_KEY_PATH=/etc/certs/key.pem
  volumes:
    - ./certs:/etc/certs
  container_name: proxy

Code released under the MIT license.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL