Sign inSign up

cryptkiddie2/redirector

By cryptkiddie2

•Updated 6 days ago

A docker container that contains nginx and redirects all http(s)-queries to given URL.

Image
0

1M+

cryptkiddie2/redirector repository overview

⁠docker-redirector

A simple NGINX that redirects all traffic to a given URL. It is meant to be run behind a reverse proxy and redirect old/unused (Sub-)Domains.

⁠Config

Configuration is kept extremly simple, all you need to do is adding up to four environmental vars in your docker-command, docker-compose-file or how ever you want to start it.

VarMeaningExample
destThe url all traffic should go to, write only the base domain (https://a.bc.de⁠) if you use keep_uridest=https://github.com/cryptkid/docker-redirector⁠"
access_logThe file to write an access-log to. Default: off"access_log=/var/log/access.log
keep_uriKeep request uri, redirect from a.example.com/bla to b.example.com/bla and not to b.example.comkeep_uri=true
acme_404Return 404 to all requests to acme-challenges in order to prevent issues with reverse proxiesacme_404=true

⁠Examples

⁠Docker command

Redirect all queries to this repo:

docker run -e dest='https://github.com/cryptkid/docker-redirector' -e access_log='off' -e keep_uri='false' -it cryptkiddie2/redirector:latest

Redirect to b.example.com keeping the requested uri (a.example.com/bla -> b.example.com/bla)

docker run -e dest='https://b.example.com' -e access_log='off' -e keep_uri='true' -it cryptkiddie2/redirector:latest
⁠docker-compose

There is an an example docker-compose.yml⁠

⁠ToDo and known issues

  • Allow multiple redirects for different sources in one container

  • https not supported (does not matter in my case because I run it behind traefik⁠

If there was anybody out there wanting to help, he/she/it could work on this and open a PR

Tag summary

Content type

Image

Digest

sha256:65c7486bc…

Size

60 MB

Last updated

6 days ago

docker pull cryptkiddie2/redirector