diff --git a/conf/Caddyfile b/conf/Caddyfile index 48ed556..62e9986 100644 --- a/conf/Caddyfile +++ b/conf/Caddyfile @@ -51,7 +51,7 @@ http:// { redir @get https://{host}{uri} 301 # initial PUT/POST for a new domain has to happen over HTTP - reverse_proxy http://{$GIT_PAGES_ADDRESS:localhost}:3000 + reverse_proxy h2c://{$GIT_PAGES_ADDRESS:localhost}:3000 } https:// { @@ -60,9 +60,9 @@ https:// { } encode - reverse_proxy http://{$GIT_PAGES_ADDRESS:localhost}:3000 + reverse_proxy h2c://{$GIT_PAGES_ADDRESS:localhost}:3000 } http://localhost:2002 { - reverse_proxy http://{$GIT_PAGES_ADDRESS:localhost}:3002 + reverse_proxy h2c://{$GIT_PAGES_ADDRESS:localhost}:3002 } diff --git a/src/main.go b/src/main.go index ccbdff1..1174aaf 100644 --- a/src/main.go +++ b/src/main.go @@ -53,7 +53,12 @@ func serve(listener net.Listener, serve func(http.ResponseWriter, *http.Request) handler = http.HandlerFunc(serve) handler = ObserveHTTPHandler(handler) handler = panicHandler(handler) - log.Fatalln(http.Serve(listener, handler)) + + server := http.Server{Handler: handler} + server.Protocols = new(http.Protocols) + server.Protocols.SetHTTP1(true) + server.Protocols.SetUnencryptedHTTP2(true) + log.Fatalln(server.Serve(listener)) } }