Who doesn’t love a new feature? It’s now possible to configure HTTP → HTTPS redirects through fly.toml
. Enabling it will return a HTTP response with a 301 status code and a redirect to the HTTPS standard port.
[[services.ports]]
handlers = ["http"]
port = 80
force_https = true
An example response
HTTP/1.1 301 Moved Permanently
location: https://example.fly.dev/
...
...
All in a day’s work!
We’ve designed this feature with the most common use case in mind. It does not support redirecting to custom HTTPS ports, returning a different status code or redirecting specific requests. Our recommendation is to implement these in your application .
Happy HTTPS redirecting!