Skip to main content

Configuration

You can use a configuration file to specify these parameters:

  • Logging format
  • Run mode
  • Port
  • Default ExtAuth response
  • URL configuration
  • Plugins
  • TLS configuration
  • Target SSL certificates
  • HTTP headers

Loading the Configuration

Gate supports various configuration formats, specified via command-line flags:

  • Environment variables: --env
  • HCL: --hcl [file name]
  • JSON: --json [file name]
  • TOML: --toml [file name]
  • YAML: --yaml [file name]

For example, to run Gate with environment variables:

GATE_PORT=8080 GATE_DEFAULT_TARGET=http://default-svc:8080 gate --env

To use a .yaml configuration file:

gate --yaml configs/gate.yaml

Help

To see a list of available flags, run:

gate --help

Using Multiple Formats

You can use multiple configuration formats simultaneously, with configurations loaded in the order flags are provided:

For example:

gate --yaml configs/gate.yaml --toml configs/gate.toml --env

In this example, Gate first loads configs/gate.yaml, then overrides the parameters specified in the YAML file with those in configs/gate.toml, and finally uses environment variables to override the previous configurations.

Configuration Merging Logic

By default, all configuration options are overridden except for URL configurations, which are appended. In this way, you can merge multiple URL sources.

info

To debug configuration issues, use the --debug flag to print the loaded configuration.