I do want to connect to my backend using either www.subdomain.domain.tld or subdomain.domain.tld. But it only works for the second one, the first one results in “no such site at :80”
Ỳes, this is intentional. It is part of a list of domains pointing to a legacy backend, part of them are supposed to support SSL, part of them not.
I did comment out the tls part, but that had no effect, still the same error for www.rathauskeller.twanda.ch.
These are the log entries I’ve got, I’m rather clueless:
`
Nov 10 06:46:05 ip-192-168-100-121 caddy[1443]: 2016/11/10 06:46:05 http: TLS handshake error from 220.181.125.149:47163: tls: client offered an unsupported, maximum protocol version of 301
Nov 10 06:46:28 ip-192-168-100-121 caddy[1443]: 2016/11/10 06:46:28 [INFO] www.rathauskeller.twanda.ch - No such site at :80 (Remote: 178.194.239.84, Referer: )
Nov 10 06:46:59 ip-192-168-100-121 caddy[1443]: 2016/11/10 06:46:59 [INFO] www.rathauskeller.twanda.ch - No such site at :80 (Remote: 178.194.239.84, Referer: )
Nov 10 06:48:35 ip-192-168-100-121 caddy[1443]: 2016/11/10 06:48:35 [INFO] www.urchigi-spezialitaete.twanda.ch - No such site at :80 (Remote: 178.194.239.84, Referer: )
Nov 10 06:48:35 ip-192-168-100-121 caddy[1443]: 2016/11/10 06:48:35 [INFO] www.urchigi-spezialitaete.twanda.ch - No such site at :80 (Remote: 178.194.239.84, Referer: http://www.urchigi-spezialitaete.twanda.ch/)
Nov 10 06:49:00 ip-192-168-100-121 caddy[1443]: 2016/11/10 06:49:00 [INFO] www.chutz.twanda.ch - No such site at :80 (Remote: 193.135.75.131, Referer: Weine - Restaurant Chutz)
Nov 10 06:49:50 ip-192-168-100-121 caddy[1443]: 2016/11/10 06:49:50 http2: server: error reading preface from client 178.194.239.84:46008: timeout waiting for client preface
Nov 10 06:50:08 ip-192-168-100-121 caddy[1443]: 2016/11/10 06:50:08 [INFO] www.maechler-hergisroos.twanda.ch - No such site at :80 (Remote: 178.194.239.84, Referer: http://www.maechler-hergisroos.ch/)
Nov 10 06:50:15 ip-192-168-100-121 caddy[1443]: 2016/11/10 06:50:15 http: TLS handshake error from 220.181.125.149:52593: tls: client offered an unsupported, maximum protocol version of 301
Nov 10 06:53:10 ip-192-168-100-121 caddy[1443]: 2016/11/10 06:53:10 [INFO] 46.51.192.240 - No such site at :80 (Remote: 212.47.237.130, Referer: )
Nov 10 06:53:28 ip-192-168-100-121 caddy[1443]: 2016/11/10 06:53:28 [INFO] twanda.ch - No such site at :443 (Remote: 178.194.239.84, Referer: )
Nov 10 06:54:08 ip-192-168-100-121 caddy[1443]: 2016/11/10 06:54:08 [INFO] twanda.ch - No such site at :443 (Remote: 178.194.239.84, Referer: )
`
I have about 40 addresses in my vhost block, can it be that if one of these addresses is wrong all addresses do not work?
Out of curiosity, what command are you using to run Caddy?
When Caddy starts up, it should log a list of all the hostnames it’s serving. Do www.rathauskeller.twanda.ch and rathauskeller.twanda.ch both show up there?
I’m using caddy.service as systemd service, as documented on the caddy website. The command is
ExecStart=/usr/local/bin/caddy -log stdout -agree=true -email=xy@anybody.com -conf=/etc/caddy/Caddyfile
I do not see a list of served hostnames on startup. But I can try to start it manually.
I’m getting closer …
When I start it manually, I get the error “duplicate site address”. Now I have found out, that I have several nano editor emergency files in my vhosts directory (where the files are to be imported in the Caddyfile). So that seems logical to me. I’m just trying to find out how to delete the emergency files (.save, .save.1).
Now the vhost file seems to be correct. I have to wait for 12 hours to test it again on the production server. I’ll let you know. Meanwhile thank you a lot for the ongoing support!