@ignoramous thanks for your answer!
In your fly.toml, add
force_https=true
to the relevantservice
(docs , example ) and check if that helps?
It was already in the default fly.toml
:
[[services.ports]]
force_https = true
handlers = ["http"]
port = 80
[[services.ports]]
handlers = ["tls", "http"]
port = 443
Verify with
curl --head http://myappname.fly.dev
Seems to work.
curl --head http://myappname.fly.dev
HTTP/1.1 301 Moved Permanently
location: https://myappname.fly.dev/
server: Fly/54d1d920f (2022-09-30)
via: 1.1 fly.io
fly-request-id: 01GFG126HSX1WF8JCT1MP4D1A1-ams
date: Sun, 16 Oct 2022 09:12:40 GMT
Alternatively, you could add a HSTS header to responses from the web server (MDN).
Never heard of this header - will have to look into it.
Or, add a
301
permanent redirect fromhttp://...
toLocation: https://...
like how we do it.
But isn’t this already the case with force_https=true
? Do I need to create & configure some certs manually?