Lightweight Docker image that redirects all web traffic to another domain/URL
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

This Docker container listens on port 80 and redirects all web traffic permanently to the given target domain/URL.


  • Lightweight: Uses only ~2 MB RAM on Linux
  • Keeps the URL path and GET parameters
  • Permanent redirect (HTTP 301)


Docker run

The target domain/URL is set by the REDIRECT_TARGET environment variable.
Possible redirect targets include domains (, paths ( or specific protocols (

Example: $ docker run --rm -d -e -p 80:80 morbz/docker-web-redirect

Paths are retained

The URL path and GET parameters are retained. That means that a request to will be redirected to when is set.

Permanent redirects

Redirects are permanent (HTTP status code 301). That means browsers will cache the redirect and will go directly to the new site on further requests. Also search engines will recognize the new domain and change their URLs. This means this image is not suitable for temporary redirects e.g. for site maintenance.

Docker Compose

This image can be combined with the jwilder nginx-proxy. A sample docker-compose file that redirects to could look like this:

version: '3'
    image: morbz/docker-web-redirect
    restart: always