Skip to main content

Home/ Larvata/ Group items tagged caddy

Rss Feed Group items tagged

張 旭

Caddyfile Tutorial - How to Configure Caddy - 0 views

  • Directives are keywords that Caddy recognizes.
  • Directives might have one or more arguments after them
  • Some directives require more configuration than can fit on one line. For those directives, you can open a block and set more parameters.
  • ...11 more annotations...
  • The first line of the Caddyfile is always the address of the site to serve
  • If the directive block is left empty, you should omit the curly braces entirely.
  • Arguments that contain whitespace must be enclosed in quotes ".
  • To configure multiple sites with a single Caddyfile, you must use curly braces around each one to separate their configurations:
  • he opening curly brace must be at the end of the same line.
  • The closing curly brace must be on its own line.
  • All directives must appear inside a site's definition.
  • Site addresses can also be defined under a specific path or have wildcards in place of individual domain labels from the left side
  • using a path in your site address will route requests by longest matching prefix.
  • Use of environment variables is allowed in addresses and arguments. They must be enclosed in curly braces,
  • you may not specify the same site address more than once
  •  
    "Directives"
張 旭

The Caddyfile Syntax - 0 views

  • A Caddyfile can be used to configure any Caddy server type: HTTP, DNS, etc.
  • The Caddyfile is plain Unicode text encoded with UTF-8.
  • lowercase and uppercase characters are different.
  • ...17 more annotations...
  • A token that starts with quotes " is read literally (including whitespace) until the next instance of quotes " that is not escaped.
  • Only quotes are escapable.
  • Blank, unquoted lines are allowed and ignored.
  • Tokens are then evaluated by the parser for structure.
  • A Caddyfile has no global scope.
  • A label is a string identifier, and a definition is a body (one or more lines) of tokens grouped together in a block
  • a Caddyfile with more than one entry must enclose each definition in curly braces { }.
  • The first line of a Caddyfile is always a label line.
  • If many labels are to head a block, the labels may be suffixed with a comma.
  • as long as the last label of the line has a comma if the next line is to continue the list of labels
  • Commas are not acceptable delimiters for arguments
  • Arguments are delimited solely by same-line whitespace
  • Subdirectives cannot open new blocks.
  • nested directive blocks are not supported
  • Any token (label, directive, argument, etc.) may contain or consist solely of an environment variable
  • Where an import line is, that line will be replaced with the contents of the imported file, unmodified.
  • define snippets to be reused later in your Caddyfile by defining a block with a single-token label surrounded by parentheses
crazylion lee

Caddy - The HTTP/2 Web Server with Fully Managed TLS - 1 views

  •  
    "The HTTP/2 web server with automatic HTTPS "
1 - 3 of 3
Showing 20 items per page