How to update Admin in Caddyfile

Trying to do something very simple here but can’t find any examples and trial and error isn’t working.

I need to bootstrap my config via Caddyfile so I can switch over to JSON but can’t figure out how to change the default admin address.

I have tried two things … without brackets around admin…

    admin '0.0.0.0:2019'

    www.simplsites.com www.simplpages.com {
            reverse_proxy 172.17.0.3:5000 {
                    header_up X-Real-IP {remote_host}
                    header_up Access-Control-Allow-Headers Cache-Control,Content-Type
            }
    }

and with brackets

{
 admin '0.0.0.0:2019'
}

www.simplsites.com www.simplpages.com {
        reverse_proxy 172.17.0.3:5000 {
                header_up X-Real-IP {remote_host}
                header_up Access-Control-Allow-Headers Cache-Control,Content-Type
        }
}

Both fail. Sorry for asking such a simple question but it doesn’t appear common for people to change admin config with a Caddyfile from the docs.

Safely ignore this. I still have some issues but I don’t think using the Caddyfile to solve this helps much. I need to move to JSON updates as quickly as possible.

Quotes in the Caddyfile are double quotes: " but they are not needed in your case.

And yes you need the brackets: Global options (Caddyfile) — Caddy Documentation

This topic was automatically closed after 30 days. New replies are no longer allowed.