Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Specify Caddy listening port

"By default, Caddy will bind to ports 80 and 443 to serve HTTPS and redirect HTTP to HTTPS." (https://caddyserver.com/docs/automatic-https)

How can we change this port?

Background: In our setup, Caddy runs behind an AWS load balancer which forwards requests from port 443 to port 4443. Therefore, we would like to have Caddy listen on 4443. (We use the DNS challenge.)

like image 733
NtlX Avatar asked Jul 06 '18 11:07

NtlX


1 Answers

According to the documentation:

The first line of the Caddyfile is always the address of the site to serve.

In your Caddyfile:

<domain>:<port>

Example:

localhost:8080
like image 69
Jens Avatar answered Nov 02 '22 06:11

Jens