Objective: I am trying to set up Caddy to listen on my hostname and proxy it to my node app with TLS cert generated by Active Directory. It would be forcing all connection to hostname:80 and hostname:443 to proxy to localhost:3000 and use the key/cert that is provided.
Would very much appreciate it if someone can chime in whether this is intentional or a bug. Also if it is intentional, how would I configure it to meet my objective?
But that shouldn’t happen with the caddyfile you provided. Providing a domain without protocols/ports should force a redirect to 443 and serve the domain under the port 443.
The default port is 2015: if you want to listen on a different port when you manually take control of HTTPS, you need to specify port 443 as mysite.org:443 or https://mysite.org. See Automatic HTTPS — Caddy Documentation – Caddy doesn’t change the ports unless automatic HTTPS is being used.