mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
Merge pull request #14 from abiosoft/master
Fix for Issue 13: Trouble running in Docker containers (or binding to 0.0.0.0)
This commit is contained in:
commit
0f332bd9fb
1 changed files with 7 additions and 0 deletions
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in a new issue