All this lightweight Docker image does is redirect all requests from [www.]olddomain.com to https://www.newdomain.com
return vs rewrite for faster executionhtp://www.old.com/blog/article will be redirected to https://www.new.com/blog/articleservices:
redirect:
image: vktrl/nginx-domain-redirect
restart: always
environment:
- OLD_DOMAIN=foo.com
- NEW_DOMAIN=bar.com
- PORT= # optional, defaults to 80
- HTTP_STATUS= # optional, defaults to 301
Using settings file:
docker run --rm -d --env-file settings.env -p 80:80 vktrl/nginx-domain-redirect
Using inline variables:
docker run --rm -d -e OLD_DOMAIN=foo.com -e NEW_DOMAIN=bar.com -p 80:80 vktrl/nginx-domain-redirect
For SSL termination and/or running nginx-domain-redirect side-by-side, you can use
Modify accordingly if it doesn't fit your needs
Content type
Image
Digest
Size
8.9 MB
Last updated
almost 7 years ago
docker pull vktrl/nginx-domain-redirect