Skip to content

Underdocumented: path match precedence #1222

@eshattow

Description

@eshattow

I would like to match all except for path prefix /.well-known/acme-challenge on one http protocol cluster, and match path prefix /.well-known/acme-challenge on another http protocol cluster, when the frontend host and port will be the same. How to do this?

Use case: Stalwart mail server on the same host as a general-use Apache2 web server; Stalwart operates JMAP protocol and web administration interface on port 443 at mail.domain.tld from the same server address as a general-use Apache2 web server; certificate renewal is maintained by use of certbot webroot operating mode, which for mail.domain.tld we want directed to Apache2 web server to serve the ACME challenge data but all other requests for mail.example.tld should be passed through to the Stalwart mail server; all requests for example.tld should be directed to Apache2 web server.

Problem 1: Not clear in documentation the precedence of PREFIX versus REGEX, so also not clear if the ordering in configuration is deterministic to allow this by defining one and then modifying the scope by a later definition.

Problem 2: Does the REGEX allow for look-around? If not, can there be an option for fancy-regex to allow this?

path = '^(\/\.well-known\/acme-challenge)', path_type = "REGEX"

above appears functional.

path = '^(?!\/\.well-known\/acme-challenge)', path_type = "REGEX"

above does not appear to be working as intended, are we missing look-around functionality in sozu?

However, pairing

path = '/', path_type = "PREFIX"

for the frontend to Stalwart mail backend port on localhost and with

path = '^(\/\.well-known\/acme-challenge)', path_type = "REGEX"

for the frontend to Apache2 web server backend port on same localhost, is functional but I don't know if this is a coincidence that it works. Is there an assured precedence?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions