An app whose sole purpose is to redirect requests to a given url.
- Go 1.19+
go build
# set some env vars
export REDIRECT_URL=https://google.com
# optionally define an alternative PORT (default=5000)
export PORT=3000
# optionally define an alternative redirect status code (default=302)
export REDIRECT_STATUS_CODE=301
# start the server
./redirect-app
# in another shell
curl -L http://localhost:5000On the Dokku host:
# Create the app
dokku apps:create xyz-redirect
# Set the redirect target URL
dokku config:set xyz-redirect REDIRECT_URL=https://example.com/xyz-page.html
# See above for other environment config variablesLocally:
# Check out this git repository
git clone https://github.com/dokku/redirect-app.git
# Add your dokku host remote address
git remote add live-server dokku@dokku-host.example.com:redirect-app
# Deploy to the dokku host
git push live-server
This will produce an application that redirects from http://xyz-redirect.dokku-host.example.com/ to https://example.com/xyz-page.html.
See Domain Configuration to configure other domains for the application.