This thing is used to redirect HTTP to HTTPS, redirect example.com
to www.example.com
, or both.
The redirector
uses environment variables for configuration. These are:
LISTEN
- Thehost:port
to listen on.STATUS
- The path to listen for status checks on. Defaults to_status
.SSL
- Enable/Disable HTTP to HTTPs redirection. Eithertrue
orfalse
.WWW
- Enable/Disable WWW redirection. Eithertrue
orfalse
.
Example: LISTEN=0.0.0.0:80 SSL=false WWW=true ./redirector
The redirector
responds with a 307 if a redirection is necessary. Otherwise a 404 response is returned.