Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Caddy - How to disable https only for one domain

I have a config file for Caddy v2 like in below:

sentry.mydomain.ru {
    reverse_proxy sentry:9000
}

tasks.mydomain.ru {
    reverse_proxy taiga-proxy:80
}

ain.mydomain.ru {
    reverse_proxy ain-frontend:80
}

Caddy makes https for every domain but I need to make disable "https" only for ain.mydomain.ru. How to do it?

like image 790
Konstantin Avatar asked Dec 12 '25 10:12

Konstantin


2 Answers

Caddy serves http traffic only if you prefix the domain with http scheme.

Here is the modified Caddyfile:

sentry.mydomain.ru {
    reverse_proxy sentry:9000
}

tasks.mydomain.ru {
    reverse_proxy taiga-proxy:80
}

http://ain.mydomain.ru {
    reverse_proxy ain-frontend:80
}

Reference: https://caddy.community/t/is-there-any-way-to-disable-tls-from-the-caddyfile/8372/2

like image 82
Bless Avatar answered Dec 14 '25 14:12

Bless


domain:80 or ip:80 will help you access your site on http mode. The example below ain.mydomain.ru will be available only on http. Also ensure tls directive is disabled for the domains you want to access via port 80 using http protocol only.

sentry.mydomain.ru {
reverse_proxy sentry:9000
}

tasks.mydomain.ru {
    reverse_proxy taiga-proxy:80
}

ain.mydomain.ru:80 {
    reverse_proxy ain-frontend:80
}
like image 25
navule Avatar answered Dec 14 '25 14:12

navule



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!