Skip to content
HTTP Redirector Docker Image
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Dockerfile
README.md
config.ru
docker-compose.yml
op.conf

README.md

HTTP Redirector Docker Image

This is a simple docker image to handle domain redirects.



Usage

Configure Redirects

Use REDIRECT* environment variables to configure redirects. The value of each such variable should be in the syntax of source==target, where source is a regular expression, and target is the URL to redirect to.

For example:

REDIRECT1=.*\.example\.com==https://www.google.com

By default, the redirect is a Temporary Redirect (302). To use a Permanent Redirect (301), prefix the target with an exclamation mark:

REDIRECT1=example.com==!https://www.google.com

Run the Server

$ docker run --rm -it -p 3000:3000 \
  -e REDIRECT1=.*\.local==https://www.google.com \
  -e REDIRECT2=.*\.lvh.me==https://github.com \
  dannyben/redirector

Docker Compose

version: '3'

services:
  web:
    image: dannyben/redirector
    ports: ["3000:3000"]
    environment:
      REDIRECT1: .*\.local==https://www.google.com \
      REDIRECT2: .*\.lvh.me==https://github.com \

You can’t perform that action at this time.