A very simple container to redirect HTTP traffic to another server, based on nginx
SERVER_REDIRECT - server to redirect to, eg. www.example.comSERVER_NAME - optionally define the server name to listen on eg. ~^www.(?<subdomain>.+).example.com
SERVER_REDIRECT_PATH - optionally define path to redirect all requests eg. /landingpage
$request_uri is usedSERVER_REDIRECT_SCHEME - optionally define scheme to redirect to
$scheme is usedSERVER_REDIRECT_CODE - optionally define the http status code to use for redirection
SERVER_REDIRECT_POST_CODE - optionally define the http code to use for POST redirection
SERVER_REDIRECT_CODE is usedSERVER_ACCESS_LOG - optionally define the location where nginx will write its access log
SERVER_ERROR_LOG - optionally define the location where nginx will write its error log
See also docker-compose.yml file.
With docker-compose
docker-compose up -d
With docker
docker run -e SERVER_REDIRECT=www.example.com -p 8888:80 schmunk42/nginx-redirect
docker run -e SERVER_REDIRECT=www.example.com -e SERVER_REDIRECT_PATH=/landingpage -p 8888:80 schmunk42/nginx-redirect
docker run -e SERVER_REDIRECT=www.example.com -e SERVER_REDIRECT_PATH=/landingpage -e SERVER_REDIRECT_SCHEME=https -p 8888:80 schmunk42/nginx-redirect
Built by dmstr
Content type
-
Digest
Size
8.5 MB
Last updated
over 6 years ago
docker pull joeizzard/nginx-redirect