-
My func main() is, essentially
And the AutoTLS works fine, but the redirect doesn't, so when I try to access my host through http it just errors. I assume that my code is straight up just incorrect, because I'm not specifying where echo should listen for http requests, because I was essentially bundling both examples together, so I would appreciate if anyone could instruct me. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi, if this is the only block contains all "echo.Start*" methods that you call I assume problem is that in production mode you are only starting HTTPS listener and are missing open port for HTTP. HTTPS and HTTP are not served on same port. If you want to have redirect from HTTP to HTTPS you need to start 2 listeners - one for HTTP and one for HTTPS. |
Beta Was this translation helpful? Give feedback.
Hi, if this is the only block contains all "echo.Start*" methods that you call I assume problem is that in production mode you are only starting HTTPS listener and are missing open port for HTTP. HTTPS and HTTP are not served on same port.
If you want to have redirect from HTTP to HTTPS you need to start 2 listeners - one for HTTP and one for HTTPS.