Commit 0f332bd9 authored by Matt Holt's avatar Matt Holt

Merge pull request #14 from abiosoft/master

Fix for Issue 13: Trouble running in Docker containers (or binding to 0.0.0.0)
parents 17fa5a93 e04e06d6
......@@ -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