Warning during validate do I need to fix this

1. Caddy version (caddy version):

v2.4.0-beta.2 h1:DUaK4qtL3T0/gAm0fVVkHgcMN04r4zGpfPUZWHRR8QU=

2. How I run Caddy:

a. System environment:

FreeNAS 12.2U3 Jail

b. Command:

service caddy reload

c. Service/unit/compose file:

Paste full file contents here.
Make sure backticks stay on their own lines,
and the post looks nice in the preview pane.

d. My complete Caddyfile or JSON config:

{
#  acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
  email mydomain@gmail.com
}

mydomain.com {
   root * /usr/local/www/html/
   file_server
   header {
      enable HSTS
      Strict-Transport-Security max-age=31536000;
   }
}
cloud.mydomain.com {

  encode gzip
  reverse_proxy http://192.168.5.81
  header {
     enable HSTS
     Strict-Transport-Security max-age=31536000;
        }
}

collabora.mydomain.com {
   encode gzip

   @collabora {
     path /loleaflet/*          # Loleaflet is the client part of LibreOffice Online
     path /hosting/discovery    # WOPI discovery URL
     path /hosting/capabilities # Show capabilities as json
     path /lool/*               # Main websocket, uploads/downloads, presentations
   }
  reverse_proxy @collabora http://192.168.5.89:9980
}

blog.mydomain.com {

  encode gzip
  reverse_proxy http://192.168.5.235
#  header {
#     enable HSTS
#     Strict-Transport-Security max-age=31536000;
#        }
}

3. The problem I’m having:

What does the “WARN input is not formatted with ‘caddy fmt’ {“adapter”: “caddyfile”, “file”: “/usr/local/www/Caddyfile”, “line”: 2}” message mean and do I need to fix it?

This is prompting you to run caddy fmt on your Caddyfile to clean up the syntax, align whitespace etc. You can run it with --overwrite to make it fix your Caddyfile in-place.

2 Likes

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