mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-03 19:17:29 -05:00 
			
		
		
		
	Fix for Issue 13: Trouble running in Docker containers (or binding to 0.0.0.0)
This commit is contained in:
		
							parent
							
								
									17fa5a9334
								
							
						
					
					
						commit
						e04e06d6e2
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user