How to completely disable https & https port?

1. The problem I’m having:

I want to completely disable https because I’m running Caddy behind a TLS Router.

I’m not using caddy for http because it’s “the best tool for the job”, but rather because I don’t want to have to learn both caddy and nginx, and more and more frequently I’m using a layer 4 router to handle TLS, so I’m just using caddy because it’s the tool I’ve been using for years and already know.

The documentation specifies how to change the default port, but not how to globally disable it.

2. Error messages and/or full log output:

N/A

3. Caddy version, 4. How I installed: N/A

5. Links to relevant resources:

automatic_https, http_port, and https_port at

Here’s my WORKING hacky-do workaround:

{
        admin off
        auto_https off
        http_port 3080
        https_port 0
}

:3080 {
        log {
                format console
        }

        respond <<TEXT
                Hello, World!

                TEXT
}

I suspect there is some sort of undocumented option and then I would be able to do something HYPOTHETICALLY more like this:

{
        admin off
        auto_https off
        http_port 3080
        https_port off
}

* {
        log {
                format console
        }

        respond <<TEXT
                Hello, World!

                TEXT
}

However off is not valid in this case, I assume 0 just picks a random port, and using * results in empty 200 OK messages.

It’s simply

{
        admin off
        http_port 3080
}

http:// {
        # stuff
}
2 Likes

Confirmed working. Thank you.

1 Like

Could we get that added to some documentation?

I believe it’s already there:

At least that’s where I’ve been taking it from in all my examples:

1 Like