* Disable StrictHostMatching for single server configs
* Add the insecure_disable_sni_matching directive
* Do not override insecure_disable_sni_matching
* Remove comment
* Add flag to enable/disable timstamps for process log.
solves #2615
* Remove timestamp argument from log.Printf()
* Add log-timestamps=false to systemd unit
* Copy log flags
* Fix argument list
The Handler interface expects a first return value of 0 if headers have
already been written.
(cf. https://godoc.org/github.com/caddyserver/caddy/caddyhttp/httpserver#Handler)
When using http.Redirect, this is the case as http.Redirect does write
headers. When using Caddy with nested handlers, returning
http.StatusMovedPermanently could cause a wrong (200) response on a
non-slashy request on a directory name. Returning 0 ensures the
redirection will always take place.
Slightly inconvenient because it uses int type and we use string, but
oh well. This fixes a bug related to setting -http-port and -https-port
flags which weren't being used by CertMagic in some cases.
* More informative rewrite test output
When running rewrite tests, the output in case of a test failure now
includes not only the rewritten URLs but also the from URL.
* Move re-escaping to regexpMatches
This commit moves the code to post-process the match replacements from
ComplexRule to regexpMatches, so it can later be re-used for SimpleRule.
Also changes the comment in an attempt to better explain the reasoning
behind that code.
The required strings.Replacer is now built only once.
* Support regex captures in simple rewrite rules
Closes#2586
* Add upstream header replacements (TODO: tests, docs)
* Add tests, fix a few bugs
* Add more tests and comments
* Refactor header_upstream to use a fallthrough; return regex errors
* Move SiteOutput to a seperate function sorted by port.
* Rename vars and tidy up
* Move loopback note to output loop
* Fix Typo
* Remove unneeded var
* Readability Change
* Change to other port string.
* Simplify as all sites in Server use the same port
* Ensure -quiet supresses fmt.Println calls
* Prevent double output of siteinfo to log - improve log message
* change name of log in comment
* Remove spaces
* Remove extra line output
* final tidy!
* Use caddy.LogDestination to setup log
* Ensure Log is still output if quiet.
* Correct case of functions and make function param bool
* Remove conditional check for LogDestination
* Revert output to simple blocks
* comment update
* Move SiteOutput to a seperate function.
* Simplify as all sites in Server use the same port
* Ensure -quiet supresses fmt.Println calls
* Prevent double output of siteinfo to log - improve log message
* Use caddy.LogDestination to setup log
* Ensure Log is still output if quiet.
By using option ca_certificates in proxy block it is possible now to select
CA against which backend certificates shall be checked.
Resolves#1550
Co-authored-by: Danny Navarro <navdgo@gmail.com>