www-redirect : A simple solution to converting bare domains -> www
This container solves a singular problem: How do you redirect users to your www.whatever.com hostname when it is CNAME'd to an external service? Especially when the DNS holding your A record doesn't support redirects.
Behold! A lightweight solution using nginx that you can stand up anywhere you can run a docker container.
Simply pass the environment variable like so:
docker run -e "REDIRECT_HOST=kingarthurflour.com" -dt ilkelma/www-redirect
Configurable environment variables
REDIRECT_HOSTThis is the A record hostname so host + TLD ex:
google.com(best to change that as above)
REDIRECT_SUBDOMAINThis the subdomain (including the final .) so
www.for www.kingarthurflour.com. Default:
No support is given here for SSL. That's out of scope for the simple lightweight set up desired. Please feel free to fork this repo and add your SSL certs to it (in private obviously).
- [ ] Add env variable for port
- [ ] Add env variable for redirect