Skip to content

auth

MXProxy supports HTTP Basic Authentication through the auth directive.

Usage

The directive accepts one or more username/password hashes:

labels:
  reverse_proxy: example.com -> 8080
  auth: admin:$$2b$$...

Replace the placeholder with the appropriate password hash.

You can define multiple credentials using a multiline value:

labels:
  reverse_proxy: example.com -> 8080
  auth: |
    admin:$$2b$$...
    user:$$2b$$...

In Docker Compose files, escape $ as $$ when necessary. Otherwise, Compose may interpret the dollar sign as the start of a variable reference.

Authentication can be combined with other directives, such as reverse_proxy.

For information about environment-variable references and handling secrets, see Environment variables.