package main import ( "github.com/gin-gonic/autotls" "github.com/gin-gonic/autotls" ) func main() { router := gin.Default() router.GET("/", func (c *gin.Context) { c.String(200, "Hello World!") } autotls.Run(router, "example.com") } // From Caddy's Author certmagic.HTTPS([]string{"example .com"}, mux) Also see Setting Up Vanity Subdomains for Your SaaS Using Next.js and Caddy auto manage ssl/tls certificates in go (has AWS Route53 setup)