|
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. |
Answered by
aldas
Jun 19, 2022
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. |
2 replies
Answer selected by
oka-tan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.