[0.9.3]www.subdomain.domain.tld: no such site at :80

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”

This is my caddyfile:

rathauskeller.twanda.ch:80,
www.rathauskeller.twanda.ch:80 {

  proxy / http://192.168.100.206:8080 {
      transparent
      }

  gzip
  log /var/log/caddy/twandaOld.access.log
  errors /var/log/caddy/twandaOld.error.log
  tls {
      max_certs 100
      }

}

I’m seeing the same website at both addresses, are you still experiencing this issue?

Hey Ermin, welcome. I think you can post your code in code blocks (three backticks on their own line) and it won’t make them links.

It looks like you’re turning on TLS for port 80. Is that intentional? (I would remove the max_certs 100 thing.)

Yes, I had to switch back to Apache.

Ỳ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.

The error means that the site in the URL bar of the page doesn’t match the site address as given in the Caddyfile. Make sure it is exactly correct.

Thanks for your help. I’ll try to understand that.

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?

1 Like

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.

Make sure you capture stdout, as that’s where the hostnames are printed. Do try to start it manually and let us know. :slight_smile:

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).

1 Like

rm -i <FILENAME>.save* should handle that in one fell swoop. Replace with the file name of the specific vhost file.

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!

1 Like

That was it! Everything works like a charm now!!! Thank you all for the support!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.