0
Fork 0
mirror of https://github.com/caddyserver/caddy.git synced 2024-12-23 22:27:38 -05:00
caddy/caddyhttp/httpserver
Matthew Holt 58085edc16 Don't treat localhost specially when assigning bind address
If we listen on 127.0.0.1:80 for `localhost` but :80 for everything else,
then a hostname in the hosts file that resolves to 127.0.0.1 will be
served on :80 (unless the bind directive is used) but the OS will use
the socket listening at 127.0.0.1:80, thus giving a "No such site" error
even though the site is there, but it's on the other listener at :80.

Two ways to fix this: 1) Leave as-is and require the user to set "bind
127.0.0.1" in their Caddyfile for all sites that are resolved in the
hosts file, or 2) Take out this special case and let localhost sites
listen on :80 (unless the user changes that with the bind directive, of
course). Having localhost bind to any interface is a little annoying
(unsettling?) but probably best in the long run.

https://forum.caddyserver.com/t/wildcard-virtual-domains-with-wildcard-roots/221/9?u=matt
2016-06-27 13:14:28 -06:00
..
condition.go Fix missed if_op refactor. Ensure with tests. 2016-06-21 20:41:09 +01:00
condition_test.go Fix missed if_op refactor. Ensure with tests. 2016-06-21 20:41:09 +01:00
context.go Migrate remaining middleware packages 2016-06-05 22:39:23 -06:00
context_test.go Migrate remaining middleware packages 2016-06-05 22:39:23 -06:00
graceful.go Rewrote Caddy from the ground up; initial commit of 0.9 branch 2016-06-04 17:00:29 -06:00
https.go Refactor how caddy.Context is stored and used 2016-06-20 11:59:23 -06:00
https_test.go Rewrote Caddy from the ground up; initial commit of 0.9 branch 2016-06-04 17:00:29 -06:00
middleware.go Condition upgrades (if, if_op) for rewrite, redir (#889) 2016-06-21 08:59:29 -06:00
middleware_test.go Rewrote Caddy from the ground up; initial commit of 0.9 branch 2016-06-04 17:00:29 -06:00
plugin.go Don't treat localhost specially when assigning bind address 2016-06-27 13:14:28 -06:00
plugin_test.go Set host and port on address if specified via flag (fixes #888) 2016-06-20 18:25:42 -06:00
recorder.go Rewrote Caddy from the ground up; initial commit of 0.9 branch 2016-06-04 17:00:29 -06:00
recorder_test.go Rewrote Caddy from the ground up; initial commit of 0.9 branch 2016-06-04 17:00:29 -06:00
replacer.go New {request} placeholder to log entire requests (sans body) (#871) 2016-06-07 11:06:24 -06:00
replacer_test.go fix for new rewrite test case and add table test to replacer (#890) 2016-06-21 18:44:16 -06:00
roller.go Rewrote Caddy from the ground up; initial commit of 0.9 branch 2016-06-04 17:00:29 -06:00
server.go Add support for Alt-Svc headers (#892) 2016-06-20 13:50:25 -06:00
server_test.go Rewrote Caddy from the ground up; initial commit of 0.9 branch 2016-06-04 17:00:29 -06:00
siteconfig.go Rewrote Caddy from the ground up; initial commit of 0.9 branch 2016-06-04 17:00:29 -06:00
vhosttrie.go Don't treat localhost specially when assigning bind address 2016-06-27 13:14:28 -06:00
vhosttrie_test.go Rewrote Caddy from the ground up; initial commit of 0.9 branch 2016-06-04 17:00:29 -06:00