Commit e04e06d6 authored by Abiola Ibrahim's avatar Abiola Ibrahim

Fix for Issue 13: Trouble running in Docker containers (or binding to 0.0.0.0)

parent 17fa5a93
......@@ -161,6 +161,13 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
host = r.Host // oh well
}
// Try the host as given, or try falling back to 0.0.0.0 (wildcard)
if _, ok := s.vhosts[host]; !ok {
if _, ok2 := s.vhosts["0.0.0.0"]; ok2 {
host = "0.0.0.0"
}
}
if vh, ok := s.vhosts[host]; ok {
w.Header().Set("Server", "Caddy")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment