http: Improve auto HTTP->HTTPS redirects, fix edge cases

See https://caddy.community/t/v2-issues-with-multiple-server-blocks-in-caddyfile-style-config/6206/13?u=matt

Also print pid when using `caddy start`
This commit is contained in:
Matthew Holt
2019-09-18 18:01:32 -06:00
parent 39d61cad2d
commit 40e05e5a01
3 changed files with 86 additions and 74 deletions

View File

@ -130,7 +130,7 @@ func cmdStart() (int, error) {
// when one of the goroutines unblocks, we're done and can exit
select {
case <-success:
fmt.Println("Successfully started Caddy")
fmt.Printf("Successfully started Caddy (pid=%d)\n", cmd.Process.Pid)
case err := <-exit:
return caddy.ExitCodeFailedStartup,
fmt.Errorf("caddy process exited with error: %v", err)