How to express a multi-line rule using YAML?

This is what I've tried:

match: >-
  Host(`contra.com`)
    && (
      Path(
        `/careers`,
        `/companies`,
        `/customers/framer-community`,
        `/customers/framer`,
        `/customers/strideux`,
        `/customers/webflow`,
        `/customers/workshop-built`,
        `/customers`,
        `/expert-networks`,
        `/experts`,
        `/flexible-talent-hiring-guide-agencies`,
        `/flexible-talent-hiring-guide`,
        `/how-it-works/clients`,
        `/how-it-works/independents`,
        `/invoicing`,
        `/mission`,
        `/policies/code-of-conduct`,
        `/policies/cookies`,
        `/policies/privacy`,
        `/policies/terms`,
        `/portfolios`,
        `/pricing`,
        `/pro/accelerator`,
        `/pro/offer`,
        `/pro`,
        `/project-os`,
        `/teams`,
        `/top-independents`
      )
      || PathPrefix(
        `/faq`,
        `/portfolios/`,
        `/screenshots/`
      )
    )

This is giving error:

error while parsing rule Host(`contra.com`) && ( Path( `/careers`, `/companies`, `/customers/framer-community`, `/customers/framer`, `/customers/strideux`, `/customers/webflow`, `/customers/workshop-built`, `/customers`, `/expert-networks`, `/experts`, `/flexible-talent-hiring-guide-agencies`, `/flexible-talent-hiring-guide`, `/how-it-works/clients`, `/how-it-works/independents`, `/invoicing`, `/mission`, `/policies/code-of-conduct`, `/policies/cookies`, `/policies/privacy`, `/policies/terms`, `/portfolios`, `/pricing`, `/pro/accelerator`, `/pro/offer`, `/pro`, `/project-os`, `/teams`, `/top-independents` ) || PathPrefix( `/faq`, `/portfolios/`, `/screenshots/` ) ): 3:3: expected 'EOF', found '&&'

Figured it out:

      match:
        Host(`contra.com`) && (
            Path(
              `/careers`,
              `/companies`,
              `/customers/framer-community`,
              `/customers/framer`,
              `/customers/strideux`,
              `/customers/webflow`,
              `/customers/workshop-built`,
              `/customers`,
              `/expert-networks`,
              `/experts`,
              `/flexible-talent-hiring-guide-agencies`,
              `/flexible-talent-hiring-guide`,
              `/how-it-works/clients`,
              `/how-it-works/independents`,
              `/invoicing`,
              `/mission`,
              `/policies/code-of-conduct`,
              `/policies/cookies`,
              `/policies/privacy`,
              `/policies/terms`,
              `/portfolios`,
              `/pricing`,
              `/pro/accelerator`,
              `/pro/offer`,
              `/pro`,
              `/project-os`,
              `/teams`,
              `/top-independents`
            ) || PathPrefix(
              `/faq`,
              `/portfolios/`,
              `/screenshots/`
            )
          )

This thread helped: Is YAML newline directive is ignored? · Issue #7074 · traefik/traefik · GitHub

1 Like