I thought my problem description was pretty clear (beside the fact that I originally entered the wrong URL). My apologies if it was not clear.
It is my understanding based on my interpretation of the documentation that Caddy reverse proxy can be configured so that if anyone were to enter a domain URL Caddy can then redirect traffic automatically to the subdomain. I attempted to configure the config file so that when anyone enters edscloud dot org, or https://edscloud.org, that traffic would automatically redirect to www dot edscloud dot org, or specifically https://www.edscloud.org, the www subdomain. I want all traffic to go to the www subdomain.
Am I incorrect in my interpretation of the Caddy documentation?
When I posted my config and described my issue I was hoping that an expert in Caddy would look at my config and tell me what I am doing wrong because with my current config, none of the domain traffic is redirecting to the www subdomain (as you can see for yourself if you attempt to go to edscloud.org).
So, again, could someone please look at my config below and tell me what I am doing wrong as I am new to Caddy and by no means a json expert.
edscloud.org, www.edscloud.org
{
# Set this path to your site's directory.
root * /usr/share/caddy
# Enable the static file server.
file_server
# Another common task is to set up a reverse proxy:
# Reverse to vm server
reverse_proxy 192.168.15.16
redir https://www.edscloud.org{uri}
# Or serve a PHP site through php-fpm:
# php_fastcgi localhost:9000
}
As for logging, here is what ‘journalctl -u caddy --no-pager | less +G’ displays with debug enabled at the time edscloud.org is accessed.
May 24 04:13:00 proxy.offworld.lan caddy[5876]: {"level":"debug","ts":1684915980.8676686,"logger":"tls.handshake","msg":"choosing certificate","identifier":"edscloud.org","num_choices":1}
May 24 04:13:00 proxy.offworld.lan caddy[5876]: {"level":"debug","ts":1684915980.8676853,"logger":"tls.handshake","msg":"default certificate selection results","identifier":"edscloud.org","subjects":["edscloud.org"],"managed":true,"issuer_key":"acme-v02.api.letsencrypt.org-directory","hash":"74304ee4dc9000cbb899d9849b3a2a27ad06eed04238b7c6316ea3b5b0d2a0de"}
May 24 04:13:00 proxy.offworld.lan caddy[5876]: {"level":"debug","ts":1684915980.8676982,"logger":"tls.handshake","msg":"matched certificate in cache","remote_ip":"154.6.82.15","remote_port":"37410","subjects":["edscloud.org"],"managed":true,"expiration":1692358590,"hash":"74304ee4dc9000cbb899d9849b3a2a27ad06eed04238b7c6316ea3b5b0d2a0de"}
May 24 04:13:00 proxy.offworld.lan caddy[5876]: {"level":"debug","ts":1684915980.9865081,"logger":"events","msg":"event","name":"tls_get_certificate","id":"be09ba44-db82-4b8a-8680-6b0345adecbc","origin":"tls","data":{"client_hello":{"CipherSuites":[4865,4867,4866,49195,49199,52393,52392,49196,49200,49162,49161,49171,49172,156,157,47,53],"ServerName":"www.edscloud.org","SupportedCurves":[29,23,24,25,256,257],"SupportedPoints":"AA==","SignatureSchemes":[1027,1283,1539,2052,2053,2054,1025,1281,1537],"SupportedProtos":["h2","http/1.1"],"SupportedVersions":[772,771],"Conn":{}}}}
May 24 04:13:00 proxy.offworld.lan caddy[5876]: {"level":"debug","ts":1684915980.9865696,"logger":"tls.handshake","msg":"choosing certificate","identifier":"www.edscloud.org","num_choices":1}
May 24 04:13:00 proxy.offworld.lan caddy[5876]: {"level":"debug","ts":1684915980.9865906,"logger":"tls.handshake","msg":"default certificate selection results","identifier":"www.edscloud.org","subjects":["www.edscloud.org"],"managed":true,"issuer_key":"acme-v02.api.letsencrypt.org-directory","hash":"c97af95983928f289e819522c7ca2a4990255994a7c8501ef29a6b1b11ee0900"}
May 24 04:13:00 proxy.offworld.lan caddy[5876]: {"level":"debug","ts":1684915980.9866054,"logger":"tls.handshake","msg":"matched certificate in cache","remote_ip":"154.6.82.15","remote_port":"37414","subjects":["www.edscloud.org"],"managed":true,"expiration":1692363287,"hash":"c97af95983928f289e819522c7ca2a4990255994a7c8501ef29a6b1b11ee0900"}
If my interpretation of the redirect documentation is incorrect, then please tell me that too.
Thank you.