Change default listen port?

I use caddy as reverse proxy which works on http/80 and https/443. All works fine if I use auto tls. Traffic to port 80 will be redirected to 443.

But if I use it to proxy a http site it won’t listen to port 80! It just bind to 2015…

I know it’s possible to add :80 or schema http:// to the domain, but would be finde to just fill the domain like example.com and disable tls and it should bind to default (http) port 80.

Any change to do that? Tried -port 80, but seems not to work. Just no http vhost listen to port 80…

Hi @pwFoo

Think of it as a quirk. Caddy binds to :2015 by default so that it ‘just works’. A LOT of systems have something already running on :80 or block it without special config. A consequence of this is that if you are not using autohttps you must either specify http:// or :80 as you noted.

We don’t have plans to change this.

Should -port 80 work for me? Will it change default port from 2015 to 80?

Yes, as long as your site labels don’t specify/override the new default port. However…

What you proxy to shouldn’t have any effect on whether or not Automatic HTTPS works; I’d suggest looking into why it doesn’t work in this case.

Of course, if you’re turning Automatic HTTPS off manually, you will indeed need -port or a scheme/port in your site labels.

Thanks @Whitestrake, solved one problem caused by the used plugin / setup (docker reverse proxy with multiple domains). So I think -port 80 should work for me now. I’ll test it during the next week.

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