Caddy - How to disable https only for one domain
Asked Answered
D

2

16

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?

Dad answered 14/7, 2020 at 13:36 Comment(0)
M
30

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

Manila answered 28/8, 2020 at 20:31 Comment(0)
E
5

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
}
Elwira answered 8/10, 2020 at 9:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.