caddy/caddyhttp
Matthew Holt e3f2d96a5e
httpserver: Flags to customize HTTP and HTTPS ports (incl. for ACME)
This commit removes _almost_ all instances of hard-coded ports 80 and
443 strings, and now allows the user to define what the HTTP and HTTPS
ports are by the -http-port and -https-ports flags.

(One instance of "80" is still hard-coded in tls.go because it cannot
import httpserver to get access to the HTTP port variable. I don't
suspect this will be a problem in practice, but one workaround would be
to define an exported variable in the caddytls package and let the
httpserver package set it as well as its own HTTPPort variable.)

The port numbers required by the ACME challenges HTTP-01 and TLS-SNI-01
are hard-coded into the spec as ports 80 and 443 for good reasons,
but the big question is whether they necessarily need to be the HTTP
and HTTPS ports. Although the answer is probably no, they chose those
ports for convenience and widest compatibility/deployability. So this
commit also assumes that the "HTTP port" is necessarily the same port
on which to serve the HTTP-01 challenge, and the "HTTPS port" is
necessarily the same one on which to serve the TLS-SNI-01 challenge. In
other words, changing the HTTP and HTTPS ports also changes the ports
the challenges will be served on.

If you change the HTTP and HTTPS ports, you are responsible for
configuring your system to forward ports 80 and 443 properly.

Closes #918 and closes #1293. Also related: #468.
2017-03-06 18:18:49 -07:00
..
basicauth Use RequestURI when redirecting to canonical path. (#1331) 2017-02-28 05:54:12 -07:00
bind Refactor how caddy.Context is stored and used 2016-06-20 11:59:23 -06:00
browse browse: Sanitize file names and links in default template 2017-01-23 22:37:46 -07:00
errors Roll all logs by default (#1379) 2017-02-08 09:23:33 -07:00
expvar Refactor how caddy.Context is stored and used 2016-06-20 11:59:23 -06:00
extensions Fix misspellings 2016-09-05 10:20:34 -06:00
fastcgi Use RequestURI when redirecting to canonical path. (#1331) 2017-02-28 05:54:12 -07:00
gzip HTTP/2 push support (golang 1.8) (#1215) 2017-02-17 09:25:22 -07:00
header HTTP/2 push support (golang 1.8) (#1215) 2017-02-17 09:25:22 -07:00
httpserver httpserver: Flags to customize HTTP and HTTPS ports (incl. for ACME) 2017-03-06 18:18:49 -07:00
internalsrv Feature #1246 - Remote syslog (#1301) 2017-02-08 08:02:09 -07:00
log Roll all logs by default (#1379) 2017-02-08 09:23:33 -07:00
markdown Feature #1246 - Remote syslog (#1301) 2017-02-08 08:02:09 -07:00
maxrequestbody Add maxrequestbody directive (#1163) 2016-11-04 08:25:49 +08:00
mime Refactor how caddy.Context is stored and used 2016-06-20 11:59:23 -06:00
pprof pprof: Set proper Content-Type header 2017-01-24 16:55:43 -07:00
proxy proxy: Fix race in test 2017-02-18 15:42:11 -07:00
push Push down headers from client (#1453) 2017-02-18 15:50:36 -07:00
redirect Merge pull request #1365 from tw4452852/1297 2017-02-15 17:59:29 -07:00
rewrite Introduce new Replacer fields {rewrite_path}, {rewrite_path_escaped}; issue #1185 (#1364) 2017-01-23 22:15:27 -07:00
root fixing panic when root is symlink (#1429) 2017-02-15 22:02:51 -07:00
staticfiles Use RequestURI when redirecting to canonical path. (#1331) 2017-02-28 05:54:12 -07:00
status Add 'status' middleware instead of 'status' directive for 'rewrite' middleware 2016-08-29 17:17:23 +03:00
templates Refactor how caddy.Context is stored and used 2016-06-20 11:59:23 -06:00
timeouts New 'timeouts' directive to configure timeouts; default timeouts enabled (#1368) 2017-01-24 08:15:25 -07:00
websocket Fix misspellings 2016-09-05 10:20:34 -06:00
caddyhttp.go HTTP/2 push support (golang 1.8) (#1215) 2017-02-17 09:25:22 -07:00
caddyhttp_test.go HTTP/2 push support (golang 1.8) (#1215) 2017-02-17 09:25:22 -07:00