> ## Documentation Index
> Fetch the complete documentation index at: https://tyk.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Tyk Gateway Configuration Options

> Configuration options and environment variables for Tyk Gateway.

export const uuid_0 = undefined

export const ulid_0 = undefined

You can use environment variables to override the config file for the Tyk Gateway. The Gateway configuration file can be found in the `tyk-gateway` folder and by default is called `tyk.conf`, though it can be renamed and specified using the `--conf` flag. Environment variables are created from the dot notation versions of the JSON objects contained with the config files.
To understand how the environment variables notation works, see [Environment Variables](/5.12/tyk-oss-gateway/configuration).

All the Gateway environment variables have the prefix `TYK_GW_`. The environment variables will take precedence over the values in the configuration file.

### Environment Variable Type Mapping

When configuring Tyk components using environment variables, it's important to understand how different data types are represented. The type of each variable is based on its definition in the Go source code. This section provides a guide on how to format values for common data types.

| Go Type                  | Environment Variable Format                | Example                                                              |
| ------------------------ | ------------------------------------------ | -------------------------------------------------------------------- |
| `string`                 | A regular string of text.                  | `TYK_GW_SECRET="mysecret"`                                           |
| `int`, `int64`           | A whole number.                            | `TYK_GW_LISTENPORT=8080`                                             |
| `bool`                   | `true` or `false`.                         | `TYK_GW_USEDBAPPCONFIG=true`                                         |
| `[]string`               | A comma-separated list of strings.         | `TYK_PMP_PUMPS_STDOUT_FILTERS_SKIPPEDAPIIDS="api1,api2,api3"`        |
| `map[string]string`      | A comma-separated list of key:value pairs. | `TYK_GW_GLOBALHEADERS="X-Tyk-Test:true,X-Tyk-Version:1.0"`           |
| `map[string]interface{}` | A JSON string representing the object.     | `TYK_GW_POLICIES_POLICYSOURCE_CONFIG='{"connection_string": "..."}'` |

<Note>
  For complex types like `map[string]interface{}`, the value should be a valid JSON string. For `[]string` and `map[string]string`, ensure there are no spaces around the commas unless they are part of the value itself.
</Note>

### tyk lint

In **v2.4** we have added a new `tyk lint` command which will validate your `tyk.conf` file and validate it for syntax correctness, misspelled attribute names or format of values. The Syntax can be:

`tyk lint` or `tyk --conf=path lint`

If `--conf` is not used, the first of the following paths to exist is used:

`./tyk.conf`
`/etc/tyk/tyk.conf`

### hostname

ENV: <b>TYK\_GW\_HOSTNAME</b><br />
Type: `string`<br />

Force your Gateway to work only on a specific domain name. Can be overridden by API custom domain.

### listen\_address

ENV: <b>TYK\_GW\_LISTENADDRESS</b><br />
Type: `string`<br />

If your machine has multiple network devices or IPs you can force the Gateway to use the IP address you want.

### listen\_port

ENV: <b>TYK\_GW\_LISTENPORT</b><br />
Type: `int`<br />

Setting this value will change the port that Tyk listens on. Default: 8080.

### control\_api\_hostname

ENV: <b>TYK\_GW\_CONTROLAPIHOSTNAME</b><br />
Type: `string`<br />

Custom hostname for the Control API

### control\_api\_port

ENV: <b>TYK\_GW\_CONTROLAPIPORT</b><br />
Type: `int`<br />

Set this to expose the Tyk Gateway API on a separate port. You can protect it behind a firewall if needed. Please make sure you follow this guide when setting the control port [https://tyk.io/docs/tyk-self-managed/#change-your-control-port](https://tyk.io/docs/tyk-self-managed/#change-your-control-port).

### secret

ENV: <b>TYK\_GW\_SECRET</b><br />
Type: `string`<br />

This should be changed as soon as Tyk is installed on your system.
This value is used in every interaction with the Tyk Gateway API. It should be passed along as the X-Tyk-Authorization header in any requests made.
Tyk assumes that you are sensible enough not to expose the management endpoints publicly and to keep this configuration value to yourself.

### node\_secret

ENV: <b>TYK\_GW\_NODESECRET</b><br />
Type: `string`<br />

The shared secret between the Gateway and the Dashboard to ensure that API Definition downloads, heartbeat and Policy loads are from a valid source.

### pid\_file\_location

ENV: <b>TYK\_GW\_PIDFILELOCATION</b><br />
Type: `string`<br />

Linux PID file location. Do not change unless you know what you are doing. Default: /var/run/tyk/tyk-gateway.pid

### allow\_insecure\_configs

ENV: <b>TYK\_GW\_ALLOWINSECURECONFIGS</b><br />
Type: `bool`<br />

Can be set to disable Dashboard message signature verification. When set to `true`, `public_key_path` can be ignored.

### public\_key\_path

ENV: <b>TYK\_GW\_PUBLICKEYPATH</b><br />
Type: `string`<br />

While communicating with the Dashboard. By default, all messages are signed by a private/public key pair. Set path to public key.

### allow\_remote\_config

ENV: <b>TYK\_GW\_ALLOWREMOTECONFIG</b><br />
Type: `bool`<br />

Allow your Dashboard to remotely set Gateway configuration via the Nodes screen.

### enable\_config\_inspection

ENV: <b>TYK\_GW\_ENABLECONFIGINSPECTION</b><br />
Type: `bool`<br />

Set to true to enable the `/config` and `/env` endpoints for configuration inspection.
Default: false

### security

Global Certificate configuration

### security.private\_certificate\_encoding\_secret

ENV: <b>TYK\_GW\_SECURITY\_PRIVATECERTIFICATEENCODINGSECRET</b><br />
Type: `string`<br />

Set the AES256 secret which is used to encode certificate private keys when they uploaded via certificate storage

### security.control\_api\_use\_mutual\_tls

ENV: <b>TYK\_GW\_SECURITY\_CONTROLAPIUSEMUTUALTLS</b><br />
Type: `bool`<br />

Enable Gateway Control API to use Mutual TLS. Certificates can be set via `security.certificates.control_api` section

### security.pinned\_public\_keys

ENV: <b>TYK\_GW\_SECURITY\_PINNEDPUBLICKEYS</b><br />
Type: `map[string]string`<br />

Specify public keys used for Certificate Pinning on global level.

### security.allow\_unsafe\_dynamic\_mtls\_token

ENV: <b>TYK\_GW\_SECURITY\_ALLOWUNSAFEDYNAMICMTLSTOKEN</b><br />
Type: `bool`<br />

AllowUnsafeDynamicMTLSToken is provided for backward compatibility with clients that are authorized using just the token for APIs secured with legacy Dynamic mTLS. If set to false (default), the client certificate must be presented and the mTLS handshake will be enforced. This is the recommended setting.

### security.certificates.upstream

ENV: <b>TYK\_GW\_SECURITY\_CERTIFICATES\_UPSTREAM</b><br />
Type: `map[string]string`<br />

Upstream is used to specify the certificates to be used in mutual TLS connections to upstream services. These are set at gateway level as a map of domain -> certificate id or path.
For example if you want Tyk to use the certificate `ab23ef123` for requests to the `example.com` upstream and `/certs/default.pem` for all other upstreams then:
In `tyk.conf` you would configure `"security": {"certificates": {"upstream": {"*": "/certs/default.pem", "example.com": "ab23ef123"}}}`
And if using environment variables you would set this to `*:/certs/default.pem,example.com:ab23ef123`.

### security.certificates.control\_api

ENV: <b>TYK\_GW\_SECURITY\_CERTIFICATES\_CONTROLAPI</b><br />
Type: `[]string`<br />

Certificates used for Control API Mutual TLS

### security.certificates.dashboard\_api

ENV: <b>TYK\_GW\_SECURITY\_CERTIFICATES\_DASHBOARD</b><br />
Type: `[]string`<br />

Used for communicating with the Dashboard if it is configured to use Mutual TLS

### security.certificates.mdcb\_api

ENV: <b>TYK\_GW\_SECURITY\_CERTIFICATES\_MDCB</b><br />
Type: `[]string`<br />

Certificates used for MDCB Mutual TLS

### security.certificate\_expiry\_monitor

CertificateExpiryMonitor configures the certificate expiry monitoring and notification feature

### security.certificate\_expiry\_monitor.warning\_threshold\_days

ENV: <b>TYK\_GW\_SECURITY\_CERTIFICATEEXPIRYMONITOR\_WARNINGTHRESHOLDDAYS</b><br />
Type: `int`<br />

WarningThresholdDays specifies the number of days before certificate expiry that the Gateway will start generating CertificateExpiringSoon events when the certificate is used
Default: DefaultWarningThresholdDays (30 days)

### security.certificate\_expiry\_monitor.check\_cooldown\_seconds

ENV: <b>TYK\_GW\_SECURITY\_CERTIFICATEEXPIRYMONITOR\_CHECKCOOLDOWNSECONDS</b><br />
Type: `int`<br />

CheckCooldownSeconds specifies the minimum time in seconds that the Gateway will leave between checking for the expiry of a certificate when it is used in an API request - if a certificate is used repeatedly this prevents unnecessary expiry checks
Default: DefaultCheckCooldownSeconds (3600 seconds = 1 hour)

### security.certificate\_expiry\_monitor.event\_cooldown\_seconds

ENV: <b>TYK\_GW\_SECURITY\_CERTIFICATEEXPIRYMONITOR\_EVENTCOOLDOWNSECONDS</b><br />
Type: `int`<br />

EventCooldownSeconds specifies the minimum time in seconds between firing the same certificate expiry event - this prevents unnecessary events from being generated for an expiring or expired certificate being used repeatedly; note that the higher of the value configured here or the default (DefaultEventCooldownSeconds) will be applied
Default: DefaultEventCooldownSeconds (86400 seconds = 24 hours)

### external\_services

ENV: <b>TYK\_GW\_EXTERNALSERVICES</b><br />
Type: `ExternalServiceConfig`<br />

External service configuration for proxy and mTLS support

### http\_server\_options

Gateway HTTP server configuration

### http\_server\_options.read\_timeout

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_READTIMEOUT</b><br />
Type: `int`<br />

API Consumer -> Gateway network read timeout. Not setting this config, or setting this to 0, defaults to 120 seconds

### http\_server\_options.write\_timeout

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_WRITETIMEOUT</b><br />
Type: `int`<br />

API Consumer -> Gateway network write timeout. Not setting this config, or setting this to 0, defaults to 120 seconds

<Note>
  If you set `proxy_default_timeout` to a value greater than 120 seconds, you must also increase [http\_server\_options.write\_timeout](/5.12/#http-server-options-write-timeout) to a value greater than `proxy_default_timeout`. The `write_timeout` setting defaults to 120 seconds and controls how long Tyk waits to write the response back to the client. If not adjusted, the client connection will be closed before the upstream response is received.
</Note>

### http\_server\_options.use\_ssl

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_USESSL</b><br />
Type: `bool`<br />

Set to true to enable SSL connections

### http\_server\_options.enable\_http2

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_ENABLEHTTP2</b><br />
Type: `bool`<br />

Enable HTTP2 protocol handling

### http\_server\_options.enable\_strict\_routes

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_ENABLESTRICTROUTES</b><br />
Type: `bool`<br />

EnableStrictRoutes changes the routing to avoid nearest-neighbour requests on overlapping routes

* if disabled, `/apple` will route to `/app`, the current default behavior,
* if enabled, `/app` only responds to `/app`, `/app/` and `/app/*` but not `/apple`

Regular expressions and parameterized routes will be left alone regardless of this setting.

### http\_server\_options.enable\_path\_prefix\_matching

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_ENABLEPATHPREFIXMATCHING</b><br />
Type: `bool`<br />

EnablePathPrefixMatching changes how the gateway matches incoming URL paths against routes (patterns) defined in the API definition.
By default, the gateway uses wildcard matching. When EnablePathPrefixMatching is enabled, it switches to prefix matching. For example, a defined path such as `/json` will only match request URLs that begin with `/json`, rather than matching any URL containing `/json`.

The gateway checks the request URL against several variations depending on whether path versioning is enabled:

* Full path (listen path + version + endpoint): `/listen-path/v4/json`
* Non-versioned full path (listen path + endpoint): `/listen-path/json`
* Path without version (endpoint only): `/json`

For patterns that start with `/`, the gateway prepends `^` before performing the check, ensuring a true prefix match.
For patterns that start with `^`, the gateway will already perform prefix matching so EnablePathPrefixMatching will have no impact.
This option allows for more specific and controlled routing of API requests, potentially reducing unintended matches. Note that you may need to adjust existing route definitions when enabling this option.

Example:

With wildcard matching, `/json` might match `/api/v1/data/json`.
With prefix matching, `/json` would not match `/api/v1/data/json`, but would match `/json/data`.

Combining EnablePathPrefixMatching with EnablePathSuffixMatching will result in exact URL matching, with `/json` being evaluated as `^/json$`.

### http\_server\_options.enable\_path\_suffix\_matching

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_ENABLEPATHSUFFIXMATCHING</b><br />
Type: `bool`<br />

EnablePathSuffixMatching changes how the gateway matches incoming URL paths against routes (patterns) defined in the API definition.
By default, the gateway uses wildcard matching. When EnablePathSuffixMatching is enabled, it switches to suffix matching. For example, a defined path such as `/json` will only match request URLs that end with `/json`, rather than matching any URL containing `/json`.

The gateway checks the request URL against several variations depending on whether path versioning is enabled:

* Full path (listen path + version + endpoint): `/listen-path/v4/json`
* Non-versioned full path (listen path + endpoint): `/listen-path/json`
* Path without version (endpoint only): `/json`

For patterns that already end with `$`, the gateway will already perform suffix matching so EnablePathSuffixMatching will have no impact. For all other patterns, the gateway appends `$` before performing the check, ensuring a true suffix match.
This option allows for more specific and controlled routing of API requests, potentially reducing unintended matches. Note that you may need to adjust existing route definitions when enabling this option.

Example:

With wildcard matching, `/json` might match `/api/v1/json/data`.
With suffix matching, `/json` would not match `/api/v1/json/data`, but would match `/api/v1/json`.

Combining EnablePathSuffixMatching with EnablePathPrefixMatching will result in exact URL matching, with `/json` being evaluated as `^/json$`.

### http\_server\_options.ssl\_insecure\_skip\_verify

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_SSLINSECURESKIPVERIFY</b><br />
Type: `bool`<br />

Disable TLS verification. Required if you are using self-signed certificates.

### http\_server\_options.enable\_websockets

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_ENABLEWEBSOCKETS</b><br />
Type: `bool`<br />

Enabled WebSockets and server side events support

### http\_server\_options.certificates

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_CERTIFICATES</b><br />
Type: `CertsData`<br />

Deprecated: Use `ssl_certificates`instead.

### http\_server\_options.ssl\_certificates

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_SSLCERTIFICATES</b><br />
Type: `[]string`<br />

Index of certificates available to the Gateway for use in client and upstream communication.
The string value in the array can be two of the following options:

1. The ID assigned to and used to identify a certificate in the Tyk Certificate Store
2. The path to a file accessible to the Gateway. This PEM file must contain the private key and public certificate pair concatenated together.

### http\_server\_options.server\_name

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_SERVERNAME</b><br />
Type: `string`<br />

Start your Gateway HTTP server on specific server name

### http\_server\_options.min\_version

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_MINVERSION</b><br />
Type: `uint16`<br />

Minimum TLS version. Possible values: [https://tyk.io/docs/api-management/certificates#tls-or-ssl](https://tyk.io/docs/api-management/certificates#tls-or-ssl)

### http\_server\_options.max\_version

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_MAXVERSION</b><br />
Type: `uint16`<br />

Maximum TLS version.

### http\_server\_options.skip\_client\_ca\_announcement

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_SKIPCLIENTCAANNOUNCEMENT</b><br />
Type: `bool`<br />

When mTLS enabled, this option allows to skip client CA announcement in the TLS handshake.
This option is useful when you have a lot of ClientCAs and you want to reduce the handshake overhead, as some clients can hit TLS handshake limits.
This option does not give any hints to the client, on which certificate to pick (but this is very rare situation when it is required)

### http\_server\_options.flush\_interval

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_FLUSHINTERVAL</b><br />
Type: `int`<br />

Set this to the number of seconds that Tyk uses to flush content from the proxied upstream connection to the open downstream connection.
This option needed be set for streaming protocols like Server Side Events, or gRPC streaming.

### http\_server\_options.skip\_url\_cleaning

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_SKIPURLCLEANING</b><br />
Type: `bool`<br />

Allow the use of a double slash in a URL path. This can be useful if you need to pass raw URLs to your API endpoints.
For example: `http://myapi.com/get/http://example.com`.

### http\_server\_options.skip\_target\_path\_escaping

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_SKIPTARGETPATHESCAPING</b><br />
Type: `bool`<br />

Disable automatic character escaping, allowing to path original URL data to the upstream.

### http\_server\_options.ssl\_ciphers

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_CIPHERS</b><br />
Type: `[]string`<br />

Custom SSL ciphers applicable when using TLS version 1.2. See the list of ciphers here [https://tyk.io/docs/api-management/certificates#supported-tls-cipher-suites](https://tyk.io/docs/api-management/certificates#supported-tls-cipher-suites)

### http\_server\_options.max\_request\_body\_size

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_MAXREQUESTBODYSIZE</b><br />
Type: `int64`<br />

MaxRequestBodySize configures a maximum size limit for request body size (in bytes) for all APIs on the Gateway.

Tyk Gateway will evaluate all API requests against this size limit and will respond with HTTP 413 status code if the body of the request is larger.

Two methods are used to perform the comparison:

* If the API Request contains the `Content-Length` header, this is directly compared against `MaxRequestBodySize`.
* If the `Content-Length` header is not provided, the Request body is read in chunks to compare total size against `MaxRequestBodySize`.

A value of zero (default) means that no maximum is set and API requests will not be tested.

See more information about setting request size limits here:
[https://tyk.io/docs/api-management/traffic-transformation/#request-size-limits](https://tyk.io/docs/api-management/traffic-transformation/#request-size-limits)

### http\_server\_options.xff\_depth

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_XFFDEPTH</b><br />
Type: `int`<br />

XFFDepth controls which position in the X-Forwarded-For chain to use for determining client IP address.
A value of 0 means using the first IP (default). this is way the Gateway has calculated the client IP historically,
the most common case, and will be used when this config is not set.
However, any non-zero value will use that position from the right in the X-Forwarded-For chain.
This is a security feature to prevent against IP spoofing attacks, and is recommended to be set to a non-zero value.
A value of 1 means using the last IP, 2 means second to last, and so on.

### http\_server\_options.max\_response\_body\_size

ENV: <b>TYK\_GW\_HTTPSERVEROPTIONS\_MAXRESPONSEBODYSIZE</b><br />
Type: `int64`<br />

MaxResponseBodySize sets an upper limit on the response body (payload) size in bytes. It defaults to 0, which means there is no restriction on the response body size.

The Gateway will return `HTTP 500 Response Body Too Large` if the response payload exceeds MaxResponseBodySize+1 bytes.

**Note:** The limit is applied only when the [Response Body Transform middleware](/5.12/api-management/traffic-transformation/response-body) is enabled.

### version\_header

ENV: <b>TYK\_GW\_VERSIONHEADER</b><br />
Type: `string`<br />

Expose version header with a given name. Works only for versioned APIs.

### suppress\_redis\_signal\_reload

ENV: <b>TYK\_GW\_SUPPRESSREDISSIGNALRELOAD</b><br />
Type: `bool`<br />

Disable dynamic API and Policy reloads, e.g. it will load new changes only on procecss start.

### reload\_interval

ENV: <b>TYK\_GW\_RELOADINTERVAL</b><br />
Type: `int64`<br />

ReloadInterval defines a duration in seconds within which the gateway responds to a reload event.
The value defaults to 1, values lower than 1 are ignored.

### hash\_keys

ENV: <b>TYK\_GW\_HASHKEYS</b><br />
Type: `bool`<br />

Enable Key hashing

### disable\_key\_actions\_by\_username

ENV: <b>TYK\_GW\_DISABLEKEYACTIONSBYUSERNAME</b><br />
Type: `bool`<br />

DisableKeyActionsByUsername disables key search by username.
When this is set to `true` you are able to search for keys only by keyID or key hash (if `hash_keys` is also set to `true`)
Note that if `hash_keys` is also set to `true` then the keyID will not be provided for APIs secured using basic auth. In this scenario the only search option would be to use key hash
If you are using the Tyk Dashboard, you must configure this setting with the same value in both Gateway and Dashboard

### hash\_key\_function

ENV: <b>TYK\_GW\_HASHKEYFUNCTION</b><br />
Type: `string`<br />

Specify the Key hashing algorithm. Possible values: murmur64, murmur128, sha256.

### basic\_auth\_hash\_key\_function

ENV: <b>TYK\_GW\_BASICAUTHHASHKEYFUNCTION</b><br />
Type: `string`<br />

Specify the Key hashing algorithm for "basic auth". Possible values: murmur64, murmur128, sha256, bcrypt.
Will default to "bcrypt" if not set.

### hash\_key\_function\_fallback

ENV: <b>TYK\_GW\_HASHKEYFUNCTIONFALLBACK</b><br />
Type: `[]string`<br />

Specify your previous key hashing algorithm if you migrated from one algorithm to another.

### enable\_hashed\_keys\_listing

ENV: <b>TYK\_GW\_ENABLEHASHEDKEYSLISTING</b><br />
Type: `bool`<br />

Allows the listing of hashed API keys

### min\_token\_length

ENV: <b>TYK\_GW\_MINTOKENLENGTH</b><br />
Type: `int`<br />

Minimum API token length

### template\_path

ENV: <b>TYK\_GW\_TEMPLATEPATH</b><br />
Type: `string`<br />

Path to error and webhook templates. Defaults to the current binary path.

### policies

The policies section allows you to define where Tyk can find its policy templates. Policy templates are similar to key definitions in that they allow you to set quotas, access rights and rate limits for keys.
Policies are loaded when Tyk starts and if changed require a hot-reload so they are loaded into memory.
A policy can be defined in a file (Open Source installations) or from the same database as the Dashboard.

### policies.policy\_source

ENV: <b>TYK\_GW\_POLICIES\_POLICYSOURCE</b><br />
Type: `string`<br />

Set this value to `file` to look in the file system for a definition file. Set to `service` to use the Dashboard service.

### policies.policy\_connection\_string

ENV: <b>TYK\_GW\_POLICIES\_POLICYCONNECTIONSTRING</b><br />
Type: `string`<br />

This option is required if `policies.policy_source` is set to `service`.
Set this to the URL of your Tyk Dashboard installation. The URL needs to be formatted as: http\://dashboard\_host:port.

### policies.policy\_record\_name

ENV: <b>TYK\_GW\_POLICIES\_POLICYRECORDNAME</b><br />
Type: `string`<br />

This option only applies in OSS deployment when the `policies.policy_source` is either set
to `file` or an empty string. If `policies.policy_path` is not set, then Tyk will load policies
from the JSON file specified by `policies.policy_record_name`.

### policies.allow\_explicit\_policy\_id

ENV: <b>TYK\_GW\_POLICIES\_ALLOWEXPLICITPOLICYID</b><br />
Type: `bool`<br />

In a Pro installation, Tyk will load Policy IDs and use the internal object-ID as the ID of the policy.
This is not portable in cases where the data needs to be moved from installation to installation.

If you set this value to `true`, then the id parameter in a stored policy (or imported policy using the Dashboard API), will be used instead of the internal ID.

This option should only be used when moving an installation to a new database.

Deprecated. Is not used in codebase.

### policies.policy\_path

ENV: <b>TYK\_GW\_POLICIES\_POLICYPATH</b><br />
Type: `string`<br />

This option only applies in OSS deployment when the `policies.policy_source` is either set
to `file` or an empty string. If `policies.policy_path` is set, then Tyk will load policies
from all the JSON files under the directory specified by the `policies.policy_path` option.
In this configuration, Tyk Gateway will allow policy management through the Gateway API.

### ports\_whitelist

ENV: <b>TYK\_GW\_PORTWHITELIST</b><br />
Type: `PortsWhiteList`<br />

Defines the ports that will be available for the API services to bind to in the format
documented here [https://tyk.io/docs/api-management/non-http-protocols/#allowing-specific-ports](https://tyk.io/docs/api-management/non-http-protocols/#allowing-specific-ports).
Ports can be configured per protocol, e.g. https, tls etc.
If configuring via environment variable `TYK_GW_PORTWHITELIST` then remember to escape
JSON strings.

### disable\_ports\_whitelist

ENV: <b>TYK\_GW\_DISABLEPORTWHITELIST</b><br />
Type: `bool`<br />

Disable port whilisting, essentially allowing you to use any port for your API.

### app\_path

ENV: <b>TYK\_GW\_APPPATH</b><br />
Type: `string`<br />

If Tyk is being used in its standard configuration (Open Source installations), then API definitions are stored in the apps folder (by default in /opt/tyk-gateway/apps).
This location is scanned for .json files and re-scanned at startup or reload.
See the API section of the Tyk Gateway API for more details.

### use\_db\_app\_configs

ENV: <b>TYK\_GW\_USEDBAPPCONFIGS</b><br />
Type: `bool`<br />

If you are a Tyk Pro user, this option will enable polling the Dashboard service for API definitions.
On startup Tyk will attempt to connect and download any relevant application configurations from from your Dashboard instance.
The files are exactly the same as the JSON files on disk with the exception of a BSON ID supplied by the Dashboard service.

### db\_app\_conf\_options

This section defines API loading and shard options. Enable these settings to selectively load API definitions on a node from your Dashboard service.

### db\_app\_conf\_options.connection\_string

ENV: <b>TYK\_GW\_DBAPPCONFOPTIONS\_CONNECTIONSTRING</b><br />
Type: `string`<br />

Set the URL to your Dashboard instance (or a load balanced instance). The URL needs to be formatted as: `http://dashboard_host:port`

### db\_app\_conf\_options.connection\_timeout

ENV: <b>TYK\_GW\_DBAPPCONFOPTIONS\_CONNECTIONTIMEOUT</b><br />
Type: `int`<br />

Set a timeout value, in seconds, for your Dashboard connection. Default value is 30.

### db\_app\_conf\_options.node\_is\_segmented

ENV: <b>TYK\_GW\_DBAPPCONFOPTIONS\_NODEISSEGMENTED</b><br />
Type: `bool`<br />

Set to `true` to enable filtering (sharding) of APIs.

### db\_app\_conf\_options.tags

ENV: <b>TYK\_GW\_DBAPPCONFOPTIONS\_TAGS</b><br />
Type: `[]string`<br />

The tags to use when filtering (sharding) Tyk Gateway nodes. Tags are processed as `OR` operations.
If you include a non-filter tag (e.g. an identifier such as `node-id-1`, this will become available to your Dashboard analytics).

### storage

This section defines your Redis configuration.

### storage.type

ENV: <b>TYK\_GW\_STORAGE\_TYPE</b><br />
Type: `string`<br />

This should be set to `redis` (lowercase)

### storage.host

ENV: <b>TYK\_GW\_STORAGE\_HOST</b><br />
Type: `string`<br />

The Redis host, by default this is set to `localhost`, but for production this should be set to a cluster.

### storage.port

ENV: <b>TYK\_GW\_STORAGE\_PORT</b><br />
Type: `int`<br />

The Redis instance port.

### storage.addrs

ENV: <b>TYK\_GW\_STORAGE\_ADDRS</b><br />
Type: `[]string`<br />

If you have multi-node setup, you should use this field instead. For example: \["host1:port1", "host2:port2"].

### storage.master\_name

ENV: <b>TYK\_GW\_STORAGE\_MASTERNAME</b><br />
Type: `string`<br />

Redis sentinel master name

### storage.sentinel\_password

ENV: <b>TYK\_GW\_STORAGE\_SENTINELPASSWORD</b><br />
Type: `string`<br />

Redis sentinel password

### storage.username

ENV: <b>TYK\_GW\_STORAGE\_USERNAME</b><br />
Type: `string`<br />

Redis user name

### storage.password

ENV: <b>TYK\_GW\_STORAGE\_PASSWORD</b><br />
Type: `string`<br />

If your Redis instance has a password set for access, you can set it here.

### storage.database

ENV: <b>TYK\_GW\_STORAGE\_DATABASE</b><br />
Type: `int`<br />

Redis database

### storage.optimisation\_max\_idle

ENV: <b>TYK\_GW\_STORAGE\_MAXIDLE</b><br />
Type: `int`<br />

Set the number of maximum idle connections in the Redis connection pool, which defaults to 100. Set to a higher value if you are expecting more traffic.

### storage.optimisation\_max\_active

ENV: <b>TYK\_GW\_STORAGE\_MAXACTIVE</b><br />
Type: `int`<br />

Set the number of maximum connections in the Redis connection pool, which defaults to 500. Set to a higher value if you are expecting more traffic.

### storage.timeout

ENV: <b>TYK\_GW\_STORAGE\_TIMEOUT</b><br />
Type: `int`<br />

Set a custom timeout for Redis network operations. Default value 5 seconds.

### storage.enable\_cluster

ENV: <b>TYK\_GW\_STORAGE\_ENABLECLUSTER</b><br />
Type: `bool`<br />

Enable Redis Cluster support

### storage.use\_ssl

ENV: <b>TYK\_GW\_STORAGE\_USESSL</b><br />
Type: `bool`<br />

Enable SSL/TLS connection between your Tyk Gateway & Redis.

### storage.ssl\_insecure\_skip\_verify

ENV: <b>TYK\_GW\_STORAGE\_SSLINSECURESKIPVERIFY</b><br />
Type: `bool`<br />

Disable TLS verification

### storage.ca\_file

ENV: <b>TYK\_GW\_STORAGE\_CAFILE</b><br />
Type: `string`<br />

Path to the CA file.

### storage.cert\_file

ENV: <b>TYK\_GW\_STORAGE\_CERTFILE</b><br />
Type: `string`<br />

Path to the cert file.

### storage.key\_file

ENV: <b>TYK\_GW\_STORAGE\_KEYFILE</b><br />
Type: `string`<br />

Path to the key file.

### storage.tls\_max\_version

ENV: <b>TYK\_GW\_STORAGE\_TLSMAXVERSION</b><br />
Type: `string`<br />

Maximum TLS version that is supported.
Options: \["1.0", "1.1", "1.2", "1.3"].
Defaults to "1.3".

### storage.tls\_min\_version

ENV: <b>TYK\_GW\_STORAGE\_TLSMINVERSION</b><br />
Type: `string`<br />

Minimum TLS version that is supported.
Options: \["1.0", "1.1", "1.2", "1.3"].
Defaults to "1.2".

### storage.compress\_api\_definitions

ENV: <b>TYK\_GW\_STORAGE\_COMPRESSAPIDEFINITIONS</b><br />
Type: `bool`<br />

When set to `true`, enables Zstd compression for API definitions stored in Redis RPC backups.
This feature significantly reduces Redis memory usage in MDCB deployments where API definitions are cached locally on Data Plane Gateways.
The Gateway can read both compressed and uncompressed formats for backward compatibility.

You can safely enable this setting on existing deployments.
The Gateway continues to load previously stored uncompressed backups and stores all new backups in compressed form.

Note: This feature works with API definitions up to 100MB uncompressed

Defaults to `false`.

### disable\_dashboard\_zeroconf

ENV: <b>TYK\_GW\_DISABLEDASHBOARDZEROCONF</b><br />
Type: `bool`<br />

Disable the capability of the Gateway to `autodiscover` the Dashboard through heartbeat messages via Redis.
The goal of zeroconf is auto-discovery, so you do not have to specify the Tyk Dashboard address in your Gateway`tyk.conf` file.
In some specific cases, for example, when the Dashboard is bound to a public domain, not accessible inside an internal network, or similar, `disable_dashboard_zeroconf` can be set to `true`, in favor of directly specifying a Tyk Dashboard address.

### slave\_options

The `slave_options` allow you to configure the RPC slave connection required for MDCB installations.
These settings must be configured for every RPC slave/worker node.

### slave\_options.use\_rpc

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_USERPC</b><br />
Type: `bool`<br />

Set to `true` to connect a worker Gateway using RPC.

### slave\_options.use\_ssl

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_USESSL</b><br />
Type: `bool`<br />

Set this option to `true` to use an SSL RPC connection.

### slave\_options.ssl\_insecure\_skip\_verify

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_SSLINSECURESKIPVERIFY</b><br />
Type: `bool`<br />

Set this option to `true` to allow the certificate validation (certificate chain and hostname) to be skipped.
This can be useful if you use a self-signed certificate.

### slave\_options.connection\_string

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_CONNECTIONSTRING</b><br />
Type: `string`<br />

Use this setting to add the URL for your MDCB or load balancer host.

### slave\_options.rpc\_key

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_RPCKEY</b><br />
Type: `string`<br />

Your organization ID to connect to the MDCB installation.

### slave\_options.api\_key

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_APIKEY</b><br />
Type: `string`<br />

This the API key of a user used to authenticate and authorize the Gateway's access through MDCB.
The user should be a standard Dashboard user with minimal privileges so as to reduce any risk if the user is compromised.
The suggested security settings are read for Real-time notifications and the remaining options set to deny.

### slave\_options.enable\_rpc\_cache

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_ENABLERPCCACHE</b><br />
Type: `bool`<br />

Set this option to `true` to enable RPC caching for keys.

### slave\_options.bind\_to\_slugs

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_BINDTOSLUGSINSTEADOFLISTENPATHS</b><br />
Type: `bool`<br />

For an Self-Managed installation this can be left at `false` (the default setting). For Legacy Cloud Gateways it must be set to ‘true’.

### slave\_options.disable\_keyspace\_sync

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_DISABLEKEYSPACESYNC</b><br />
Type: `bool`<br />

Set this option to `true` if you don’t want to monitor changes in the keys from a primary Gateway.

### slave\_options.group\_id

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_GROUPID</b><br />
Type: `string`<br />

This is the `zone` that this instance inhabits, e.g. the cluster/data-center the Gateway lives in.
The group ID must be the same across all the Gateways of a data-center/cluster which are also sharing the same Redis instance.
This ID should also be unique per cluster (otherwise another Gateway cluster can pick up your keyspace events and your cluster will get zero updates).

### slave\_options.call\_timeout

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_CALLTIMEOUT</b><br />
Type: `int`<br />

Call Timeout allows to specify a time in seconds for the maximum allowed duration of a RPC call.

### slave\_options.ping\_timeout

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_PINGTIMEOUT</b><br />
Type: `int`<br />

The maximum time in seconds that a RPC ping can last.

### slave\_options.rpc\_pool\_size

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_RPCPOOLSIZE</b><br />
Type: `int`<br />

The number of RPC connections in the pool. Basically it creates a set of connections that you can re-use as needed. Defaults to 5.

### slave\_options.key\_space\_sync\_interval

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_KEYSPACESYNCINTERVAL</b><br />
Type: `float32`<br />

You can use this to set a period for which the Gateway will check if there are changes in keys that must be synchronized. If this value is not set then it will default to 10 seconds.

### slave\_options.rpc\_cert\_cache\_expiration

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_RPCCERTCACHEEXPIRATION</b><br />
Type: `float32`<br />

RPCCertCacheExpiration defines the expiration time of the rpc cache that stores the certificates, defined in seconds

### slave\_options.rpc\_global\_cache\_expiration

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_RPCGLOBALCACHEEXPIRATION</b><br />
Type: `float32`<br />

RPCKeysCacheExpiration defines the expiration time of the rpc cache that stores the keys, defined in seconds

### slave\_options.rpc\_cert\_fetch\_max\_elapsed\_time

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_RPCCERTFETCHMAXELAPSEDTIME</b><br />
Type: `float32`<br />

RPCCertFetchMaxElapsedTime sets the maximum time in seconds to retry certificate fetch from MDCB during startup (default: 30)

### slave\_options.rpc\_cert\_fetch\_initial\_interval

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_RPCCERTFETCHINITIALINTERVAL</b><br />
Type: `float32`<br />

RPCCertFetchInitialInterval sets the initial retry interval in seconds for certificate fetch backoff (default: 0.1)

### slave\_options.rpc\_cert\_fetch\_max\_interval

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_RPCCERTFETCHMAXINTERVAL</b><br />
Type: `float32`<br />

RPCCertFetchMaxInterval sets the maximum retry interval in seconds for certificate fetch backoff (default: 2)

### slave\_options.rpc\_cert\_fetch\_retry\_enabled

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_RPCCERTFETCHRETRYENABLED</b><br />
Type: `*bool`<br />

RPCCertFetchRetryEnabled enables exponential backoff retry for certificate fetch from MDCB during startup (default: true)

### slave\_options.rpc\_cert\_fetch\_max\_retries

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_RPCCERTFETCHMAXRETRIES</b><br />
Type: `*int`<br />

RPCCertFetchMaxRetries sets the maximum number of retry attempts for certificate fetch. 0 means unlimited (time-based only) (default: 3)

### slave\_options.synchroniser\_enabled

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_SYNCHRONISERENABLED</b><br />
Type: `bool`<br />

SynchroniserEnabled enable this config if MDCB has enabled the synchoniser. If disabled then it will ignore signals to synchonise recources

### slave\_options.dns\_monitor

DNSMonitor configures background DNS monitoring for proactive detection of MDCB DNS changes

### slave\_options.dns\_monitor.enabled

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_DNSMONITOR\_ENABLED</b><br />
Type: `bool`<br />

Enable background DNS monitoring for proactive detection of MDCB DNS changes

### slave\_options.dns\_monitor.check\_interval

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_DNSMONITOR\_CHECKINTERVAL</b><br />
Type: `int`<br />

Check interval in seconds for DNS monitoring (default: 30)

### slave\_options.sync\_used\_certs\_only

ENV: <b>TYK\_GW\_SLAVEOPTIONS\_SYNCUSEDCERTSONLY</b><br />
Type: `bool`<br />

Set to true to sync only certificates used by loaded APIs.
Only applies when use\_rpc is true.
Prevents proactive sync of unused certificates from control plane.
Certificates are fetched on-demand via RPC and cached locally.
Note: Certificates accumulate over time as they are used; they are not removed when APIs are deleted.
Reduces memory usage and log noise in segmented deployments.

### management\_node

ENV: <b>TYK\_GW\_MANAGEMENTNODE</b><br />
Type: `bool`<br />

If set to `true`, distributed rate limiter will be disabled for this node, and it will be excluded from any rate limit calculation.

<Note>
  If you set `db_app_conf_options.node_is_segmented` to `true` for multiple Gateway nodes, you should ensure that `management_node` is set to `false`.
  This is to ensure visibility for the management node across all APIs.
</Note>

For pro installations, `management_node` is not a valid configuration option.
Always set `management_node` to `false` in pro environments.

### auth\_override

This is used as part of the RPC / Hybrid back-end configuration in a Tyk Enterprise installation and isn’t used anywhere else.

### enable\_fixed\_window\_rate\_limiter

ENV: <b>TYK\_GW\_ENABLEFIXEDWINDOWRATELIMITER</b><br />
Type: `bool`<br />

EnableFixedWindow enables fixed window rate limiting.

### enable\_redis\_rolling\_limiter

ENV: <b>TYK\_GW\_ENABLEREDISROLLINGLIMITER</b><br />
Type: `bool`<br />

Redis based rate limiter with sliding log. Provides 100% rate limiting accuracy, but require two additional Redis roundtrips for each request.

### enable\_sentinel\_rate\_limiter

ENV: <b>TYK\_GW\_ENABLESENTINELRATELIMITER</b><br />
Type: `bool`<br />

To enable, set to `true`. The sentinel-based rate limiter delivers a smoother performance curve as rate-limit calculations happen off-thread, but a stricter time-out based cool-down for clients. For example, when a throttling action is triggered, they are required to cool-down for the period of the rate limit.
Disabling the sentinel based rate limiter will make rate-limit calculations happen on-thread and therefore offers a staggered cool-down and a smoother rate-limit experience for the client.
For example, you can slow your connection throughput to regain entry into your rate limit. This is more of a “throttle” than a “block”.
The standard rate limiter offers similar performance as the sentinel-based limiter. This is disabled by default.

### enable\_rate\_limit\_smoothing

ENV: <b>TYK\_GW\_ENABLERATELIMITSMOOTHING</b><br />
Type: `bool`<br />

EnableRateLimitSmoothing enables or disables rate limit smoothing. The rate smoothing is only supported on the
Redis Rate Limiter, or the Sentinel Rate Limiter, as both algorithms implement a sliding log.

### enable\_non\_transactional\_rate\_limiter

ENV: <b>TYK\_GW\_ENABLENONTRANSACTIONALRATELIMITER</b><br />
Type: `bool`<br />

An enhancement for the Redis and Sentinel rate limiters, that offers a significant improvement in performance by not using transactions on Redis rate-limit buckets.

### drl\_notification\_frequency

ENV: <b>TYK\_GW\_DRLNOTIFICATIONFREQUENCY</b><br />
Type: `int`<br />

How frequently a distributed rate limiter synchronises information between the Gateway nodes. Default: 2 seconds.

### drl\_threshold

ENV: <b>TYK\_GW\_DRLTHRESHOLD</b><br />
Type: `float64`<br />

A distributed rate limiter is inaccurate on small rate limits, and it will fallback to a Redis or Sentinel rate limiter on an individual user basis, if its rate limiter lower then threshold.
A Rate limiter threshold calculated using the following formula: `rate_threshold = drl_threshold * number_of_gateways`.
So you have 2 Gateways, and your threshold is set to 5, if a user rate limit is larger than 10, it will use the distributed rate limiter algorithm.
Default: 5

### drl\_enable\_sentinel\_rate\_limiter

ENV: <b>TYK\_GW\_DRLENABLESENTINELRATELIMITER</b><br />
Type: `bool`<br />

Controls which algorthm to use as a fallback when your distributed rate limiter can't be used.

### enforce\_org\_data\_age

ENV: <b>TYK\_GW\_ENFORCEORGDATAAGE</b><br />
Type: `bool`<br />

Allows you to dynamically configure analytics expiration on a per organization level

### enforce\_org\_data\_detail\_logging

ENV: <b>TYK\_GW\_ENFORCEORGDATADETAILLOGGING</b><br />
Type: `bool`<br />

Allows you to dynamically configure detailed logging on a per organization level

### enforce\_org\_quotas

ENV: <b>TYK\_GW\_ENFORCEORGQUOTAS</b><br />
Type: `bool`<br />

Allows you to dynamically configure organization quotas on a per organization level

### monitor

The monitor section is useful if you wish to enforce a global trigger limit on organization and user quotas.
This feature will trigger a webhook event to fire when specific triggers are reached.
Triggers can be global (set in the node), by organization (set in the organization session object) or by key (set in the key session object)

While Organization-level and Key-level triggers can be tiered (e.g. trigger at 10%, trigger at 20%, trigger at 80%), in the node-level configuration only a global value can be set.
If a global value and specific trigger level are the same the trigger will only fire once:

```
"monitor": {
  "enable_trigger_monitors": true,
  "configuration": {
   "method": "POST",
   "target_path": "http://domain.com/notify/quota-trigger",
   "template_path": "templates/monitor_template.json",
   "header_map": {
     "some-secret": "89787855"
   },
   "event_timeout": 10
 },
 "global_trigger_limit": 80.0,
 "monitor_user_keys": false,
 "monitor_org_keys": true
},
```

### monitor.enable\_trigger\_monitors

ENV: <b>TYK\_GW\_MONITOR\_ENABLETRIGGERMONITORS</b><br />
Type: `bool`<br />

Set this to `true` to have monitors enabled in your configuration for the node.

### monitor.configuration.method

ENV: <b>TYK\_GW\_MONITOR\_CONFIG\_METHOD</b><br />
Type: `string`<br />

The method to use for the webhook.

### monitor.configuration.target\_path

ENV: <b>TYK\_GW\_MONITOR\_CONFIG\_TARGETPATH</b><br />
Type: `string`<br />

The target path on which to send the request.

### monitor.configuration.template\_path

ENV: <b>TYK\_GW\_MONITOR\_CONFIG\_TEMPLATEPATH</b><br />
Type: `string`<br />

The template to load in order to format the request.

### monitor.configuration.header\_map

ENV: <b>TYK\_GW\_MONITOR\_CONFIG\_HEADERLIST</b><br />
Type: `map[string]string`<br />

Headers to set when firing the webhook.

### monitor.configuration.event\_timeout

ENV: <b>TYK\_GW\_MONITOR\_CONFIG\_EVENTTIMEOUT</b><br />
Type: `int64`<br />

The cool-down for the event so it does not trigger again (in seconds).

### monitor.global\_trigger\_limit

ENV: <b>TYK\_GW\_MONITOR\_GLOBALTRIGGERLIMIT</b><br />
Type: `float64`<br />

The trigger limit, as a percentage of the quota that must be reached in order to trigger the event, any time the quota percentage is increased the event will trigger.

### monitor.monitor\_user\_keys

ENV: <b>TYK\_GW\_MONITOR\_MONITORUSERKEYS</b><br />
Type: `bool`<br />

Apply the monitoring subsystem to user keys.

### monitor.monitor\_org\_keys

ENV: <b>TYK\_GW\_MONITOR\_MONITORORGKEYS</b><br />
Type: `bool`<br />

Apply the monitoring subsystem to organization keys.

### max\_idle\_connections

ENV: <b>TYK\_GW\_MAXIDLECONNS</b><br />
Type: `int`<br />

Maximum idle connections, per API, between Tyk and Upstream. By default not limited.

### max\_idle\_connections\_per\_host

ENV: <b>TYK\_GW\_MAXIDLECONNSPERHOST</b><br />
Type: `int`<br />

Maximum idle connections, per API, per upstream, between Tyk and Upstream.
A value of `0` will use the default from the Go standard library, which is 2 connections. Tyk recommends setting this value to `500` for production environments.

### max\_conn\_time

ENV: <b>TYK\_GW\_MAXCONNTIME</b><br />
Type: `int64`<br />

Maximum connection time. If set it will force gateway reconnect to the upstream.

### close\_connections

ENV: <b>TYK\_GW\_CLOSECONNECTIONS</b><br />
Type: `bool`<br />

If set, disable keepalive between User and Tyk

### enable\_custom\_domains

ENV: <b>TYK\_GW\_ENABLECUSTOMDOMAINS</b><br />
Type: `bool`<br />

Allows you to use custom domains

### allow\_master\_keys

ENV: <b>TYK\_GW\_ALLOWMASTERKEYS</b><br />
Type: `bool`<br />

If AllowMasterKeys is set to true, session objects (key definitions) that do not have explicit access rights set
will be allowed by Tyk. This means that keys that are created have access to ALL APIs, which in many cases is
unwanted behavior unless you are sure about what you are doing.

### service\_discovery.default\_cache\_timeout

ENV: <b>TYK\_GW\_SERVICEDISCOVERY\_DEFAULTCACHETIMEOUT</b><br />
Type: `int`<br />

Service discovery cache timeout

### proxy\_ssl\_insecure\_skip\_verify

ENV: <b>TYK\_GW\_PROXYSSLINSECURESKIPVERIFY</b><br />
Type: `bool`<br />

Globally ignore TLS verification between Tyk and your Upstream services

### proxy\_enable\_http2

ENV: <b>TYK\_GW\_PROXYENABLEHTTP2</b><br />
Type: `bool`<br />

Enable HTTP2 support between Tyk and your upstream service. Required for gRPC.

### proxy\_ssl\_min\_version

ENV: <b>TYK\_GW\_PROXYSSLMINVERSION</b><br />
Type: `uint16`<br />

Minimum TLS version for connection between Tyk and your upstream service.

### proxy\_ssl\_max\_version

ENV: <b>TYK\_GW\_PROXYSSLMAXVERSION</b><br />
Type: `uint16`<br />

Maximum TLS version for connection between Tyk and your upstream service.

### proxy\_ssl\_ciphers

ENV: <b>TYK\_GW\_PROXYSSLCIPHERSUITES</b><br />
Type: `[]string`<br />

Allow list of ciphers for connection between Tyk and your upstream service.

### proxy\_default\_timeout

ENV: <b>TYK\_GW\_PROXYDEFAULTTIMEOUT</b><br />
Type: `float64`<br />

This can specify a default timeout in seconds for upstream API requests.
Default: 30 seconds

<Note>
  If you set `proxy_default_timeout` to a value greater than 120 seconds, you must also increase [http\_server\_options.write\_timeout](/5.12/#http-server-options-write-timeout) to a value greater than `proxy_default_timeout`. The `write_timeout` setting defaults to 120 seconds and controls how long Tyk waits to write the response back to the client. If not adjusted, the client connection will be closed before the upstream response is received.
</Note>

### proxy\_ssl\_disable\_renegotiation

ENV: <b>TYK\_GW\_PROXYSSLDISABLERENEGOTIATION</b><br />
Type: `bool`<br />

Disable TLS renegotiation.

### proxy\_close\_connections

ENV: <b>TYK\_GW\_PROXYCLOSECONNECTIONS</b><br />
Type: `bool`<br />

Disable keepalives between Tyk and your upstream service.
Set this value to `true` to force Tyk to close the connection with the server, otherwise the connections will remain open for as long as your OS keeps TCP connections open.
This can cause a file-handler limit to be exceeded. Setting to false can have performance benefits as the connection can be reused.

### uptime\_tests

Tyk nodes can provide uptime awareness, uptime testing and analytics for your underlying APIs uptime and availability.
Tyk can also notify you when a service goes down.

### uptime\_tests.disable

ENV: <b>TYK\_GW\_UPTIMETESTS\_DISABLE</b><br />
Type: `bool`<br />

To disable uptime tests on this node, set this value to `true`.

### uptime\_tests.poller\_group

ENV: <b>TYK\_GW\_UPTIMETESTS\_POLLERGROUP</b><br />
Type: `string`<br />

If you have multiple Gateway clusters connected to the same Redis instance, you need to set a unique poller group for each cluster.

### uptime\_tests.config.failure\_trigger\_sample\_size

ENV: <b>TYK\_GW\_UPTIMETESTS\_CONFIG\_FAILURETRIGGERSAMPLESIZE</b><br />
Type: `int`<br />

The sample size to trigger a `HostUp` or `HostDown` event. For example, a setting of 3 will require at least three failures to occur before the uptime test is triggered.

### uptime\_tests.config.time\_wait

ENV: <b>TYK\_GW\_UPTIMETESTS\_CONFIG\_TIMEWAIT</b><br />
Type: `int`<br />

The value in seconds between tests runs. All tests will run simultaneously. This value will set the time between those tests. So a value of 60 will run all uptime tests every 60 seconds.

### uptime\_tests.config.checker\_pool\_size

ENV: <b>TYK\_GW\_UPTIMETESTS\_CONFIG\_CHECKERPOOLSIZE</b><br />
Type: `int`<br />

The goroutine pool size to keep idle for uptime tests. If you have many uptime tests running at a high time period, then increase this value.

### uptime\_tests.config.enable\_uptime\_analytics

ENV: <b>TYK\_GW\_UPTIMETESTS\_CONFIG\_ENABLEUPTIMEANALYTICS</b><br />
Type: `bool`<br />

Set this value to `true` to have the node capture and record analytics data regarding the uptime tests.

### health\_check

This section enables the configuration of the health-check API endpoint and the size of the sample data cache (in seconds).

### health\_check.enable\_health\_checks

ENV: <b>TYK\_GW\_HEALTHCHECK\_ENABLEHEALTHCHECKS</b><br />
Type: `bool`<br />

Setting this value to `true` will enable the health-check endpoint on /Tyk/health.

### health\_check.health\_check\_value\_timeouts

ENV: <b>TYK\_GW\_HEALTHCHECK\_HEALTHCHECKVALUETIMEOUT</b><br />
Type: `int64`<br />

This setting defaults to 60 seconds. This is the time window that Tyk uses to sample health-check data.
You can set a higher value for more accurate data (a larger sample period), or a lower value for less accurate data.
The reason this value is configurable is because sample data takes up space in your Redis DB to store the data to calculate samples. On high-availability systems this may not be desirable and smaller values may be preferred.

### health\_check\_endpoint\_name

ENV: <b>TYK\_GW\_HEALTHCHECKENDPOINTNAME</b><br />
Type: `string`<br />

HealthCheckEndpointName Enables you to change the liveness endpoint.
Default is "/hello"

### readiness\_check\_endpoint\_name

ENV: <b>TYK\_GW\_READINESSCHECKENDPOINTNAME</b><br />
Type: `string`<br />

ReadinessCheckEndpointName Enables you to change the readiness endpoint
Default is "/ready"

### graceful\_shutdown\_timeout\_duration

ENV: <b>TYK\_GW\_GRACEFULSHUTDOWNTIMEOUTDURATION</b><br />
Type: `int`<br />

GracefulShutdownTimeoutDuration sets how many seconds the gateway should wait for an existing connection
to finish before shutting down the server. Defaults to 30 seconds.

### oauth\_refresh\_token\_expire

ENV: <b>TYK\_GW\_OAUTHREFRESHEXPIRE</b><br />
Type: `int64`<br />

Change the expiry time of a refresh token. By default 14 days (in seconds).

### oauth\_token\_expire

ENV: <b>TYK\_GW\_OAUTHTOKENEXPIRE</b><br />
Type: `int32`<br />

Change the expiry time of OAuth tokens (in seconds).

### oauth\_token\_expired\_retain\_period

ENV: <b>TYK\_GW\_OAUTHTOKENEXPIREDRETAINPERIOD</b><br />
Type: `int32`<br />

Specifies how long expired tokens are stored in Redis. The value is in seconds and the default is 0. Using the default means expired tokens are never removed from Redis.

### oauth\_redirect\_uri\_separator

ENV: <b>TYK\_GW\_OAUTHREDIRECTURISEPARATOR</b><br />
Type: `string`<br />

Character which should be used as a separator for OAuth redirect URI URLs. Default: ;.

### oauth\_error\_status\_code

ENV: <b>TYK\_GW\_OAUTHERRORSTATUSCODE</b><br />
Type: `int`<br />

Configures the OAuth error status code returned. If not set, it defaults to a 403 error.

### enable\_key\_logging

ENV: <b>TYK\_GW\_ENABLEKEYLOGGING</b><br />
Type: `bool`<br />

By default all key IDs in logs are hidden. Set to `true` if you want to see them for debugging reasons.

### ssl\_force\_common\_name\_check

ENV: <b>TYK\_GW\_SSLFORCECOMMONNAMECHECK</b><br />
Type: `bool`<br />

Force the validation of the hostname against the common name, even if TLS verification is disabled.

### enable\_analytics

ENV: <b>TYK\_GW\_ENABLEANALYTICS</b><br />
Type: `bool`<br />

Tyk is capable of recording every hit to your API to a database with various filtering parameters. Set this value to `true` and fill in the sub-section below to enable logging.

<Note>
  For performance reasons, Tyk will store traffic data to Redis initially and then purge the data from Redis to MongoDB or other data stores on a regular basis as determined by the purge\_delay setting in your Tyk Pump configuration.
</Note>

### analytics\_config

This section defines options on what analytics data to store.

### analytics\_config.type

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_TYPE</b><br />
Type: `string`<br />

Set empty for a Self-Managed installation or `rpc` for multi-cloud.

### analytics\_config.ignored\_ips

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_IGNOREDIPS</b><br />
Type: `[]string`<br />

Adding IP addresses to this list will cause Tyk to ignore these IPs in the analytics data. These IP addresses will not produce an analytics log record.
This is useful for health checks and other samplers that might skew usage data.
The IP addresses must be provided as a JSON array, with the values being single IPs. CIDR values are not supported.

### analytics\_config.enable\_detailed\_recording

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_ENABLEDETAILEDRECORDING</b><br />
Type: `bool`<br />

Set this value to `true` to have Tyk store the inbound request and outbound response data in HTTP Wire format as part of the Analytics data.
Please note, this will greatly increase your analytics DB size and can cause performance degradation on analytics processing by the Dashboard.
This setting can be overridden with an organization flag, enabed at an API level, or on individual Key level.

### analytics\_config.enable\_geo\_ip

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_ENABLEGEOIP</b><br />
Type: `bool`<br />

Tyk can store GeoIP information based on MaxMind DB’s to enable GeoIP tracking on inbound request analytics. Set this value to `true` and assign a DB using the `geo_ip_db_path` setting.

### analytics\_config.geo\_ip\_db\_path

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_GEOIPDBLOCATION</b><br />
Type: `string`<br />

Path to a MaxMind GeoIP database
The analytics GeoIP DB can be replaced on disk. It will cleanly auto-reload every hour.

### analytics\_config.normalise\_urls

This section describes methods that enable you to normalise inbound URLs in your analytics to have more meaningful per-path data.

### analytics\_config.normalise\_urls.enabled

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_NORMALISEURLS\_ENABLED</b><br />
Type: `bool`<br />

Set this to `true` to enable normalisation.

### analytics\_config.normalise\_urls.normalise\_uuids

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_NORMALISEURLS\_NORMALISEUUIDS</b><br />
Type: `bool`<br />

Each UUID will be replaced with a placeholder {uuid_0}

### analytics\_config.normalise\_urls.normalise\_ulids

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_NORMALISEURLS\_NORMALISEULIDS</b><br />
Type: `bool`<br />

Each ULID will be replaced with a placeholder {ulid_0}

### analytics\_config.normalise\_urls.normalise\_numbers

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_NORMALISEURLS\_NORMALISENUMBERS</b><br />
Type: `bool`<br />

Set this to true to have Tyk automatically match for numeric IDs, it will match with a preceding slash so as not to capture actual numbers:

### analytics\_config.normalise\_urls.custom\_patterns

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_NORMALISEURLS\_CUSTOM</b><br />
Type: `[]string`<br />

This is a list of custom patterns you can add. These must be valid regex strings. Tyk will replace these values with a `{var}` placeholder.

### analytics\_config.pool\_size

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_POOLSIZE</b><br />
Type: `int`<br />

Number of workers used to process analytics. Defaults to number of CPU cores.

### analytics\_config.records\_buffer\_size

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_RECORDSBUFFERSIZE</b><br />
Type: `uint64`<br />

Number of records in analytics queue, per worker. Default: 1000.

### analytics\_config.storage\_expiration\_time

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_STORAGEEXPIRATIONTIME</b><br />
Type: `int`<br />

You can set a time (in seconds) to configure how long analytics are kept if they are not processed. The default is 60 seconds.
This is used to prevent the potential infinite growth of Redis analytics storage.

### analytics\_config.enable\_multiple\_analytics\_keys

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_ENABLEMULTIPLEANALYTICSKEYS</b><br />
Type: `bool`<br />

Set this to `true` to have Tyk automatically divide the analytics records in multiple analytics keys.
This is especially useful when `storage.enable_cluster` is set to `true` since it will distribute the analytic keys across all the cluster nodes.

### analytics\_config.purge\_interval

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_PURGEINTERVAL</b><br />
Type: `float32`<br />

You can set the interval length on how often the tyk Gateway will purge analytics data. This value is in seconds and defaults to 10 seconds.

### analytics\_config.serializer\_type

ENV: <b>TYK\_GW\_ANALYTICSCONFIG\_SERIALIZERTYPE</b><br />
Type: `string`<br />

Determines the serialization engine for analytics. Available options: msgpack, and protobuf. By default, msgpack.

### enable\_separate\_analytics\_store

ENV: <b>TYK\_GW\_ENABLESEPERATEANALYTICSSTORE</b><br />
Type: `bool`<br />

Enable separate analytics storage. Used together with `analytics_storage`.

### analytics\_storage.type

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_TYPE</b><br />
Type: `string`<br />

This should be set to `redis` (lowercase)

### analytics\_storage.host

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_HOST</b><br />
Type: `string`<br />

The Redis host, by default this is set to `localhost`, but for production this should be set to a cluster.

### analytics\_storage.port

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_PORT</b><br />
Type: `int`<br />

The Redis instance port.

### analytics\_storage.addrs

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_ADDRS</b><br />
Type: `[]string`<br />

If you have multi-node setup, you should use this field instead. For example: \["host1:port1", "host2:port2"].

### analytics\_storage.master\_name

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_MASTERNAME</b><br />
Type: `string`<br />

Redis sentinel master name

### analytics\_storage.sentinel\_password

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_SENTINELPASSWORD</b><br />
Type: `string`<br />

Redis sentinel password

### analytics\_storage.username

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_USERNAME</b><br />
Type: `string`<br />

Redis user name

### analytics\_storage.password

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_PASSWORD</b><br />
Type: `string`<br />

If your Redis instance has a password set for access, you can set it here.

### analytics\_storage.database

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_DATABASE</b><br />
Type: `int`<br />

Redis database

### analytics\_storage.optimisation\_max\_idle

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_MAXIDLE</b><br />
Type: `int`<br />

Set the number of maximum idle connections in the Redis connection pool, which defaults to 100. Set to a higher value if you are expecting more traffic.

### analytics\_storage.optimisation\_max\_active

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_MAXACTIVE</b><br />
Type: `int`<br />

Set the number of maximum connections in the Redis connection pool, which defaults to 500. Set to a higher value if you are expecting more traffic.

### analytics\_storage.timeout

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_TIMEOUT</b><br />
Type: `int`<br />

Set a custom timeout for Redis network operations. Default value 5 seconds.

### analytics\_storage.enable\_cluster

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_ENABLECLUSTER</b><br />
Type: `bool`<br />

Enable Redis Cluster support

### analytics\_storage.use\_ssl

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_USESSL</b><br />
Type: `bool`<br />

Enable SSL/TLS connection between your Tyk Gateway & Redis.

### analytics\_storage.ssl\_insecure\_skip\_verify

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_SSLINSECURESKIPVERIFY</b><br />
Type: `bool`<br />

Disable TLS verification

### analytics\_storage.ca\_file

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_CAFILE</b><br />
Type: `string`<br />

Path to the CA file.

### analytics\_storage.cert\_file

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_CERTFILE</b><br />
Type: `string`<br />

Path to the cert file.

### analytics\_storage.key\_file

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_KEYFILE</b><br />
Type: `string`<br />

Path to the key file.

### analytics\_storage.tls\_max\_version

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_TLSMAXVERSION</b><br />
Type: `string`<br />

Maximum TLS version that is supported.
Options: \["1.0", "1.1", "1.2", "1.3"].
Defaults to "1.3".

### analytics\_storage.tls\_min\_version

ENV: <b>TYK\_GW\_ANALYTICSSTORAGE\_TLSMINVERSION</b><br />
Type: `string`<br />

Minimum TLS version that is supported.
Options: \["1.0", "1.1", "1.2", "1.3"].
Defaults to "1.2".

### liveness\_check.check\_duration

ENV: <b>TYK\_GW\_LIVENESSCHECK\_CHECKDURATION</b><br />
Type: `time.Duration`<br />

Frequencies of performing interval healthchecks for Redis, Dashboard, and RPC layer.
Expressed in Nanoseconds. For example: 1000000000 -> 1s.
Default: 10 seconds.

### dns\_cache

This section enables the global configuration of the expireable DNS records caching for your Gateway API endpoints.
By design caching affects only http(s), ws(s) protocols APIs and doesn’t affect any plugin/middleware DNS queries.

```
"dns_cache": {
  "enabled": true, //Turned off by default
  "ttl": 60, //Time in seconds before the record will be removed from cache
  "multiple_ips_handle_strategy": "random" //A strategy, which will be used when dns query will reply with more than 1 ip address per single host.
}
```

### dns\_cache.enabled

ENV: <b>TYK\_GW\_DNSCACHE\_ENABLED</b><br />
Type: `bool`<br />

Setting this value to `true` will enable caching of DNS queries responses used for API endpoint’s host names. By default caching is disabled.

### dns\_cache.ttl

ENV: <b>TYK\_GW\_DNSCACHE\_TTL</b><br />
Type: `int64`<br />

This setting allows you to specify a duration in seconds before the record will be removed from cache after being added to it on the first DNS query resolution of API endpoints.
Setting `ttl` to `-1` prevents record from being expired and removed from cache on next check interval.

### dns\_cache.multiple\_ips\_handle\_strategy

ENV: <b>TYK\_GW\_DNSCACHE\_MULTIPLEIPSHANDLESTRATEGY</b><br />
Type: `string`<br />

A strategy which will be used when a DNS query will reply with more than 1 IP Address per single host.
As a DNS query response IP Addresses can have a changing order depending on DNS server balancing strategy (eg: round robin, geographically dependent origin-ip ordering, etc) this option allows you to not to limit the connection to the first host in a cached response list or prevent response caching.

* `pick_first` will instruct your Tyk Gateway to connect to the first IP in a returned IP list and cache the response.
* `random` will instruct your Tyk Gateway to connect to a random IP in a returned IP list and cache the response.
* `no_cache` will instruct your Tyk Gateway to connect to the first IP in a returned IP list and fetch each addresses list without caching on each API endpoint DNS query.

### disable\_regexp\_cache

ENV: <b>TYK\_GW\_DISABLEREGEXPCACHE</b><br />
Type: `bool`<br />

If set to `true` this allows you to disable the regular expression cache. The default setting is `false`.

### regexp\_cache\_expire

ENV: <b>TYK\_GW\_REGEXPCACHEEXPIRE</b><br />
Type: `int32`<br />

If you set `disable_regexp_cache` to `false`, you can use this setting to limit how long the regular expression cache is kept for in seconds.
The default is 60 seconds. This must be a positive value. If you set to 0 this uses the default value.

### local\_session\_cache

Tyk can cache some data locally, this can speed up lookup times on a single node and lower the number of connections and operations being done on Redis. It will however introduce a slight delay when updating or modifying keys as the cache must expire.
This does not affect rate limiting.

### local\_session\_cache.disable\_cached\_session\_state

ENV: <b>TYK\_GW\_LOCALSESSIONCACHE\_DISABLECACHESESSIONSTATE</b><br />
Type: `bool`<br />

By default sessions are set to cache. Set this to `true` to stop Tyk from caching keys locally on the node.

### enable\_separate\_cache\_store

ENV: <b>TYK\_GW\_ENABLESEPERATECACHESTORE</b><br />
Type: `bool`<br />

Enable to use a separate Redis for cache storage

### cache\_storage.type

ENV: <b>TYK\_GW\_CACHESTORAGE\_TYPE</b><br />
Type: `string`<br />

This should be set to `redis` (lowercase)

### cache\_storage.host

ENV: <b>TYK\_GW\_CACHESTORAGE\_HOST</b><br />
Type: `string`<br />

The Redis host, by default this is set to `localhost`, but for production this should be set to a cluster.

### cache\_storage.port

ENV: <b>TYK\_GW\_CACHESTORAGE\_PORT</b><br />
Type: `int`<br />

The Redis instance port.

### cache\_storage.addrs

ENV: <b>TYK\_GW\_CACHESTORAGE\_ADDRS</b><br />
Type: `[]string`<br />

If you have multi-node setup, you should use this field instead. For example: \["host1:port1", "host2:port2"].

### cache\_storage.master\_name

ENV: <b>TYK\_GW\_CACHESTORAGE\_MASTERNAME</b><br />
Type: `string`<br />

Redis sentinel master name

### cache\_storage.sentinel\_password

ENV: <b>TYK\_GW\_CACHESTORAGE\_SENTINELPASSWORD</b><br />
Type: `string`<br />

Redis sentinel password

### cache\_storage.username

ENV: <b>TYK\_GW\_CACHESTORAGE\_USERNAME</b><br />
Type: `string`<br />

Redis user name

### cache\_storage.password

ENV: <b>TYK\_GW\_CACHESTORAGE\_PASSWORD</b><br />
Type: `string`<br />

If your Redis instance has a password set for access, you can set it here.

### cache\_storage.database

ENV: <b>TYK\_GW\_CACHESTORAGE\_DATABASE</b><br />
Type: `int`<br />

Redis database

### cache\_storage.optimisation\_max\_idle

ENV: <b>TYK\_GW\_CACHESTORAGE\_MAXIDLE</b><br />
Type: `int`<br />

Set the number of maximum idle connections in the Redis connection pool, which defaults to 100. Set to a higher value if you are expecting more traffic.

### cache\_storage.optimisation\_max\_active

ENV: <b>TYK\_GW\_CACHESTORAGE\_MAXACTIVE</b><br />
Type: `int`<br />

Set the number of maximum connections in the Redis connection pool, which defaults to 500. Set to a higher value if you are expecting more traffic.

### cache\_storage.timeout

ENV: <b>TYK\_GW\_CACHESTORAGE\_TIMEOUT</b><br />
Type: `int`<br />

Set a custom timeout for Redis network operations. Default value 5 seconds.

### cache\_storage.enable\_cluster

ENV: <b>TYK\_GW\_CACHESTORAGE\_ENABLECLUSTER</b><br />
Type: `bool`<br />

Enable Redis Cluster support

### cache\_storage.use\_ssl

ENV: <b>TYK\_GW\_CACHESTORAGE\_USESSL</b><br />
Type: `bool`<br />

Enable SSL/TLS connection between your Tyk Gateway & Redis.

### cache\_storage.ssl\_insecure\_skip\_verify

ENV: <b>TYK\_GW\_CACHESTORAGE\_SSLINSECURESKIPVERIFY</b><br />
Type: `bool`<br />

Disable TLS verification

### cache\_storage.ca\_file

ENV: <b>TYK\_GW\_CACHESTORAGE\_CAFILE</b><br />
Type: `string`<br />

Path to the CA file.

### cache\_storage.cert\_file

ENV: <b>TYK\_GW\_CACHESTORAGE\_CERTFILE</b><br />
Type: `string`<br />

Path to the cert file.

### cache\_storage.key\_file

ENV: <b>TYK\_GW\_CACHESTORAGE\_KEYFILE</b><br />
Type: `string`<br />

Path to the key file.

### cache\_storage.tls\_max\_version

ENV: <b>TYK\_GW\_CACHESTORAGE\_TLSMAXVERSION</b><br />
Type: `string`<br />

Maximum TLS version that is supported.
Options: \["1.0", "1.1", "1.2", "1.3"].
Defaults to "1.3".

### cache\_storage.tls\_min\_version

ENV: <b>TYK\_GW\_CACHESTORAGE\_TLSMINVERSION</b><br />
Type: `string`<br />

Minimum TLS version that is supported.
Options: \["1.0", "1.1", "1.2", "1.3"].
Defaults to "1.2".

### enable\_bundle\_downloader

ENV: <b>TYK\_GW\_ENABLEBUNDLEDOWNLOADER</b><br />
Type: `bool`<br />

Enable downloading Plugin bundles
Example:

```
"enable_bundle_downloader": true,
"bundle_base_url": "http://my-bundle-server.com/bundles/",
"public_key_path": "/path/to/my/pubkey",
```

### bundle\_base\_url

ENV: <b>TYK\_GW\_BUNDLEBASEURL</b><br />
Type: `string`<br />

Is a base URL that will be used to download the bundle. In this example we have `bundle-latest.zip` specified in the API settings, Tyk will fetch the following URL: [http://my-bundle-server.com/bundles/bundle-latest.zip](http://my-bundle-server.com/bundles/bundle-latest.zip) (see the next section for details).

### bundle\_insecure\_skip\_verify

ENV: <b>TYK\_GW\_BUNDLEINSECURESKIPVERIFY</b><br />
Type: `bool`<br />

Disable TLS validation for bundle URLs

### skip\_verify\_existing\_plugin\_bundle

ENV: <b>TYK\_GW\_SKIPVERIFYEXISTINGPLUGINBUNDLE</b><br />
Type: `bool`<br />

SkipVerifyExistingPluginBundle skips checksum verification for plugin bundles already on disk.

Tyk always verifies the integrity of plugin bundles when downloading them for the first time to local disk. For security against corruption of the bundles after they have been loaded, it then re-verifies bundle checksum (for signed bundles) when loading each API that uses the plugins.

In trusted environments, this reverification may be unnecessary and can be skipped using this option, reducing the API load time.

### enable\_jsvm

ENV: <b>TYK\_GW\_ENABLEJSVM</b><br />
Type: `bool`<br />

Set to true if you are using JSVM custom middleware or virtual endpoints.

### jsvm\_timeout

ENV: <b>TYK\_GW\_JSVMTIMEOUT</b><br />
Type: `int`<br />

Set the execution timeout for JSVM plugins and virtal endpoints

### disable\_virtual\_path\_blobs

ENV: <b>TYK\_GW\_DISABLEVIRTUALPATHBLOBS</b><br />
Type: `bool`<br />

Disable virtual endpoints and the code will not be loaded into the VM when the API definition initialises.
This is useful for systems where you want to avoid having third-party code run.

### tyk\_js\_path

ENV: <b>TYK\_GW\_TYKJSPATH</b><br />
Type: `string`<br />

Path to the JavaScript file which will be pre-loaded for any JSVM middleware or virtual endpoint. Useful for defining global shared functions.

### middleware\_path

ENV: <b>TYK\_GW\_MIDDLEWAREPATH</b><br />
Type: `string`<br />

Path to the plugins dirrectory. By default is \`\`./middleware\`.

### coprocess\_options

Configuration options for Python and gRPC plugins.

### coprocess\_options.enable\_coprocess

ENV: <b>TYK\_GW\_COPROCESSOPTIONS\_ENABLECOPROCESS</b><br />
Type: `bool`<br />

Enable gRPC and Python plugins

### coprocess\_options.coprocess\_grpc\_server

ENV: <b>TYK\_GW\_COPROCESSOPTIONS\_COPROCESSGRPCSERVER</b><br />
Type: `string`<br />

Address of gRPC user

### coprocess\_options.grpc\_recv\_max\_size

ENV: <b>TYK\_GW\_COPROCESSOPTIONS\_GRPCRECVMAXSIZE</b><br />
Type: `int`<br />

Maximum message which can be received from a gRPC server

### coprocess\_options.grpc\_send\_max\_size

ENV: <b>TYK\_GW\_COPROCESSOPTIONS\_GRPCSENDMAXSIZE</b><br />
Type: `int`<br />

Maximum message which can be sent to gRPC server

### coprocess\_options.grpc\_authority

ENV: <b>TYK\_GW\_COPROCESSOPTIONS\_GRPCAUTHORITY</b><br />
Type: `string`<br />

Authority used in GRPC connection

### coprocess\_options.grpc\_round\_robin\_load\_balancing

ENV: <b>TYK\_GW\_COPROCESSOPTIONS\_GRPCROUNDROBINLOADBALANCING</b><br />
Type: `bool`<br />

GRPCRoundRobinLoadBalancing enables round robin load balancing for gRPC services; you must provide the address of the load balanced service using `dns:///` protocol in `coprocess_grpc_server`.

### coprocess\_options.python\_path\_prefix

ENV: <b>TYK\_GW\_COPROCESSOPTIONS\_PYTHONPATHPREFIX</b><br />
Type: `string`<br />

Sets the path to built-in Tyk modules. This will be part of the Python module lookup path. The value used here is the default one for most installations.

### coprocess\_options.python\_version

ENV: <b>TYK\_GW\_COPROCESSOPTIONS\_PYTHONVERSION</b><br />
Type: `string`<br />

If you have multiple Python versions installed you can specify your version.

### ignore\_endpoint\_case

ENV: <b>TYK\_GW\_IGNOREENDPOINTCASE</b><br />
Type: `bool`<br />

Ignore the case of any endpoints for APIs managed by Tyk. Setting this to `true` will override any individual API and Ignore, Blacklist and Whitelist plugin endpoint settings.

### ignore\_canonical\_mime\_header\_key

ENV: <b>TYK\_GW\_IGNORECANONICALMIMEHEADERKEY</b><br />
Type: `bool`<br />

When enabled Tyk ignores the canonical format of the MIME header keys.

For example when a request header with a “my-header” key is injected using “global\_headers”, the upstream would typically get it as “My-Header”. When this flag is enabled it will be sent as “my-header” instead.

Current support is limited to JavaScript plugins, global header injection, virtual endpoint and JQ transform header rewrites.
This functionality doesn’t affect headers that are sent by the HTTP client and the default formatting will apply in this case.

For technical details refer to the [CanonicalMIMEHeaderKey](https://golang.org/pkg/net/textproto/#CanonicalMIMEHeaderKey) functionality in the Go documentation.

### log\_level

ENV: <b>TYK\_GW\_LOGLEVEL</b><br />
Type: `string`<br />

You can now set a logging level (log\_level). The following levels can be set: debug, info, warn, error.
If not set or left empty, it will default to `info`.

### log\_format

ENV: <b>TYK\_GW\_LOGFORMAT</b><br />
Type: `string`<br />

You can now configure the log format to be either the standard or json format
If not set or left empty, it will default to `standard`.

### access\_logs

AccessLogs configures the output for access logs.
If not configured, the access log is disabled.

### access\_logs.enabled

ENV: <b>TYK\_GW\_ACCESSLOGS\_ENABLED</b><br />
Type: `bool`<br />

Enabled controls the generation of access logs by the Gateway. Default: false.

### access\_logs.template

ENV: <b>TYK\_GW\_ACCESSLOGS\_TEMPLATE</b><br />
Type: `[]string`<br />

Template configures which fields to include in the access log.
If no template is configured, all available fields will be logged.

Example: \["client\_ip", "path"].

Template Options:

* `api_key` will include the obfuscated or hashed key.
* `circuit_breaker_state` will include the circuit breaker state when applicable.
* `client_ip` will include the IP of the request.
* `error_source` will include the source of an error (e.g., ReverseProxy).
* `error_target` will include the target that caused an error.
* `host` will include the host of the request.
* `latency_gateway` will include the gateway processing latency.
* `latency_total` will include the total latency of the request.
* `method` will include the request method.
* `org_id` will include the organization ID.
* `path` will include the path of the request.
* `protocol` will include the protocol of the request.
* `remote_addr` will include the remote address of the request.
* `response_code_details` will include detailed error description for 5XX responses.
* `response_flag` will include the error classification flag (e.g., URT, UCF, TLE).
* `status` will include the response status code.
* `tls_cert_expiry` will include the TLS certificate expiry date when applicable.
* `tls_cert_subject` will include the TLS certificate subject when applicable.
* `trace_id` will include the OpenTelemetry trace ID when tracing is enabled.
* `upstream_addr` will include the upstream address (scheme, host and path).
* `upstream_latency` will include the upstream latency of the request.
* `upstream_status` will include the upstream response status code for 5XX responses.
* `user_agent` will include the user agent of the request.

### tracing

Section for configuring OpenTracing support
Deprecated: use OpenTelemetry instead.

### tracing.name

ENV: <b>TYK\_GW\_TRACER\_NAME</b><br />
Type: `string`<br />

The name of the tracer to initialize. For instance appdash, to use appdash tracer

### tracing.enabled

ENV: <b>TYK\_GW\_TRACER\_ENABLED</b><br />
Type: `bool`<br />

Enable tracing

### tracing.options

ENV: <b>TYK\_GW\_TRACER\_OPTIONS</b><br />
Type: `map[string]interface{}`<br />

Tracing configuration. Refer to the Tracing Docs for the full list of options.

### opentelemetry

Section for configuring OpenTelemetry.

### opentelemetry.enabled

ENV: <b>TYK\_GW\_OPENTELEMETRY\_ENABLED</b><br />
Type: `bool`<br />

A flag that can be used to enable or disable the trace exporter.

### opentelemetry.

Shared exporter/transport configuration.

### opentelemetry.exporter

ENV: <b>TYK\_GW\_OPENTELEMETRY\_EXPORTER</b><br />
Type: `string`<br />

The type of the exporter to sending data in OTLP protocol.
This should be set to the same type of the OpenTelemetry collector.
Valid values are "grpc", or "http".
Defaults to "grpc".

### opentelemetry.endpoint

ENV: <b>TYK\_GW\_OPENTELEMETRY\_ENDPOINT</b><br />
Type: `string`<br />

OpenTelemetry collector endpoint to connect to.
Defaults to "localhost:4317".

### opentelemetry.headers

ENV: <b>TYK\_GW\_OPENTELEMETRY\_HEADERS</b><br />
Type: `map[string]string`<br />

A map of headers that will be sent with HTTP requests to the collector.

### opentelemetry.connection\_timeout

ENV: <b>TYK\_GW\_OPENTELEMETRY\_CONNECTIONTIMEOUT</b><br />
Type: `int`<br />

Timeout for establishing a connection to the collector.
Defaults to 1 second.

### opentelemetry.resource\_name

ENV: <b>TYK\_GW\_OPENTELEMETRY\_RESOURCENAME</b><br />
Type: `string`<br />

Name of the resource that will be used to identify the resource.
Defaults to "tyk".

### opentelemetry.tls

TLS configuration for the exporter.

### opentelemetry.tls.enable

ENV: <b>TYK\_GW\_OPENTELEMETRY\_TLS\_ENABLE</b><br />
Type: `bool`<br />

Flag that can be used to enable TLS. Defaults to false (disabled).

### opentelemetry.tls.insecure\_skip\_verify

ENV: <b>TYK\_GW\_OPENTELEMETRY\_TLS\_INSECURESKIPVERIFY</b><br />
Type: `bool`<br />

Flag that can be used to skip TLS verification if TLS is enabled.
Defaults to false.

### opentelemetry.tls.ca\_file

ENV: <b>TYK\_GW\_OPENTELEMETRY\_TLS\_CAFILE</b><br />
Type: `string`<br />

Path to the CA file.

### opentelemetry.tls.cert\_file

ENV: <b>TYK\_GW\_OPENTELEMETRY\_TLS\_CERTFILE</b><br />
Type: `string`<br />

Path to the cert file.

### opentelemetry.tls.key\_file

ENV: <b>TYK\_GW\_OPENTELEMETRY\_TLS\_KEYFILE</b><br />
Type: `string`<br />

Path to the key file.

### opentelemetry.tls.max\_version

ENV: <b>TYK\_GW\_OPENTELEMETRY\_TLS\_MAXVERSION</b><br />
Type: `string`<br />

Maximum TLS version that is supported.
Options: \["1.0", "1.1", "1.2", "1.3"].
Defaults to "1.3".

### opentelemetry.tls.min\_version

ENV: <b>TYK\_GW\_OPENTELEMETRY\_TLS\_MINVERSION</b><br />
Type: `string`<br />

Minimum TLS version that is supported.
Options: \["1.0", "1.1", "1.2", "1.3"].
Defaults to "1.2".

### opentelemetry.span\_processor\_type

ENV: <b>TYK\_GW\_OPENTELEMETRY\_SPANPROCESSORTYPE</b><br />
Type: `string`<br />

Type of the span processor to use. Valid values are "simple" or "batch".
Defaults to "batch".

### opentelemetry.span\_batch\_config

Configuration for the batch span processor.
Only applies when SpanProcessorType is "batch".

### opentelemetry.span\_batch\_config.max\_queue\_size

ENV: <b>TYK\_GW\_OPENTELEMETRY\_SPANBATCHCONFIG\_MAXQUEUESIZE</b><br />
Type: `int`<br />

MaxQueueSize is the maximum queue size to buffer spans for delayed processing.
If the queue gets full it drops the spans.
The default value is 2048.

### opentelemetry.span\_batch\_config.max\_export\_batch\_size

ENV: <b>TYK\_GW\_OPENTELEMETRY\_SPANBATCHCONFIG\_MAXEXPORTBATCHSIZE</b><br />
Type: `int`<br />

MaxExportBatchSize is the maximum number of spans to process in a single batch.
If there are more than one batch worth of spans then it processes multiple batches
of spans one batch after the other without any delay.
The default value is 512.

### opentelemetry.span\_batch\_config.batch\_timeout

ENV: <b>TYK\_GW\_OPENTELEMETRY\_SPANBATCHCONFIG\_BATCHTIMEOUT</b><br />
Type: `int`<br />

BatchTimeout is the maximum duration for constructing a batch. Processor
forcefully sends available spans when timeout is reached.
The default value is 5 seconds.

### opentelemetry.context\_propagation

ENV: <b>TYK\_GW\_OPENTELEMETRY\_CONTEXTPROPAGATION</b><br />
Type: `string`<br />

Type of the context propagator to use. Valid values are:

* "tracecontext": tracecontext is a propagator that supports the W3C
  Trace Context format ([https://www.w3.org/TR/trace-context/](https://www.w3.org/TR/trace-context/)).
* "b3": b3 is a propagator serializes SpanContext to/from B3 multi Headers format.
* "custom": custom propagator reads from and writes to a custom header only.
* "composite": composite propagator reads from custom header (priority) or standard headers,
  and writes to both custom and standard headers.
  Defaults to "tracecontext".

### opentelemetry.custom\_trace\_header

ENV: <b>TYK\_GW\_OPENTELEMETRY\_CUSTOMTRACEHEADER</b><br />
Type: `string`<br />

Name of custom header to use for trace ID instead of standard "traceparent".
When set with context\_propagation="custom", the gateway will extract trace context
from this header and propagate it using the same custom header.
When set with context\_propagation="tracecontext" or "b3", the gateway will extract
trace context from this header (priority) or standard headers (fallback), and propagate
using standard headers only.
When set with context\_propagation="composite", the gateway will extract trace context
from this header (priority) or standard headers (fallback), and propagate using both
custom and standard headers.
Example: "X-Correlation-ID", "X-Request-ID", "X-Trace-ID"

The header value should be a valid OpenTelemetry Trace ID: a 32-character (16-byte)
lowercase hex string with at least one non-zero byte
(e.g. "0102030405060708090a0b0c0d0e0f10"). UUIDs with dashes are also accepted
(e.g. "550e8400-e29b-41d4-a716-446655440000") — dashes are removed automatically.
See: [https://opentelemetry.io/docs/specs/otel/trace/api/](https://opentelemetry.io/docs/specs/otel/trace/api/)

If the value contains non-hex characters, those characters will be stripped and the
remaining hex characters will be zero-padded to 32 characters. This means arbitrary
strings like "my-request-id" will NOT produce a predictable trace ID. To ensure
trace ID consistency between the custom header and the reported trace, always send
a valid OpenTelemetry Trace ID or UUID.

### opentelemetry.sampling

Defines the configurations to use in the sampler.

### opentelemetry.sampling.type

ENV: <b>TYK\_GW\_OPENTELEMETRY\_SAMPLING\_TYPE</b><br />
Type: `string`<br />

Refers to the policy used by OpenTelemetry to determine
whether a particular trace should be sampled or not. It's determined at the
start of a trace and the decision is propagated down the trace. Valid Values are:
AlwaysOn, AlwaysOff and TraceIDRatioBased. It defaults to AlwaysOn.

### opentelemetry.sampling.rate

ENV: <b>TYK\_GW\_OPENTELEMETRY\_SAMPLING\_RATE</b><br />
Type: `float64`<br />

Parameter for the TraceIDRatioBased sampler type and represents the percentage
of traces to be sampled. The value should fall between 0.0 (0%) and 1.0 (100%). For instance, if
the sampling rate is set to 0.5, the sampler will aim to sample approximately 50% of the traces.
By default, it's set to 0.5.

### opentelemetry.sampling.parent\_based

ENV: <b>TYK\_GW\_OPENTELEMETRY\_SAMPLING\_PARENTBASED</b><br />
Type: `bool`<br />

Rule that ensures that if we decide to record data for a particular operation,
we'll also record data for all the subsequent work that operation causes (its "child spans").
This approach helps in keeping the entire story of a transaction together. Typically, ParentBased
is used in conjunction with TraceIDRatioBased. Using it with AlwaysOn or AlwaysOff might not be as
effective since, in those cases, you're either recording everything or nothing, and there are no
intermediary decisions to consider. The default value for this option is false.

### newrelic.app\_name

ENV: <b>TYK\_GW\_NEWRELIC\_APPNAME</b><br />
Type: `string`<br />

New Relic Application name

### newrelic.license\_key

ENV: <b>TYK\_GW\_NEWRELIC\_LICENSEKEY</b><br />
Type: `string`<br />

New Relic License key

### newrelic.enable\_distributed\_tracing

ENV: <b>TYK\_GW\_NEWRELIC\_ENABLEDISTRIBUTEDTRACING</b><br />
Type: `bool`<br />

Enable distributed tracing

### enable\_http\_profiler

ENV: <b>TYK\_GW\_HTTPPROFILE</b><br />
Type: `bool`<br />

Enable debugging of your Tyk Gateway by exposing profiling information through [https://tyk.io/docs/api-management/troubleshooting-debugging](https://tyk.io/docs/api-management/troubleshooting-debugging)

### use\_redis\_log

ENV: <b>TYK\_GW\_USEREDISLOG</b><br />
Type: `bool`<br />

Enables the real-time Gateway log view in the Dashboard.

<Note>
  For logs to appear in the Tyk Dashboard, both the Gateway and the Dashboard must be configured to use the **same Redis instance**.
  In deployments where the Data Plane (Gateway) and Control Plane (Dashboard) use separate Redis instances,
  enabling this option on the Gateway will not make logs available in the Dashboard.
</Note>

### use\_sentry

ENV: <b>TYK\_GW\_USESENTRY</b><br />
Type: `bool`<br />

Enable Sentry logging

### sentry\_code

ENV: <b>TYK\_GW\_SENTRYCODE</b><br />
Type: `string`<br />

Sentry API code

### sentry\_log\_level

ENV: <b>TYK\_GW\_SENTRYLOGLEVEL</b><br />
Type: `string`<br />

Log verbosity for Sentry logging

### use\_syslog

ENV: <b>TYK\_GW\_USESYSLOG</b><br />
Type: `bool`<br />

Enable Syslog log output

### syslog\_transport

ENV: <b>TYK\_GW\_SYSLOGTRANSPORT</b><br />
Type: `string`<br />

Syslong transport to use. Values: tcp or udp.

### syslog\_network\_addr

ENV: <b>TYK\_GW\_SYSLOGNETWORKADDR</b><br />
Type: `string`<br />

Graylog server address

### use\_graylog

ENV: <b>TYK\_GW\_USEGRAYLOG</b><br />
Type: `bool`<br />

Use Graylog log output

### graylog\_network\_addr

ENV: <b>TYK\_GW\_GRAYLOGNETWORKADDR</b><br />
Type: `string`<br />

Graylog server address

### use\_logstash

ENV: <b>TYK\_GW\_USELOGSTASH</b><br />
Type: `bool`<br />

Use logstash log output

### logstash\_transport

ENV: <b>TYK\_GW\_LOGSTASHTRANSPORT</b><br />
Type: `string`<br />

Logstash network transport. Values: tcp or udp.

### logstash\_network\_addr

ENV: <b>TYK\_GW\_LOGSTASHNETWORKADDR</b><br />
Type: `string`<br />

Logstash server address

### track\_404\_logs

ENV: <b>TYK\_GW\_TRACK404LOGS</b><br />
Type: `bool`<br />

Show 404 HTTP errors in your Gateway application logs

### statsd\_connection\_string

ENV: <b>TYK\_GW\_STATSDCONNECTIONSTRING</b><br />
Type: `string`<br />

Address of StatsD server. If set enable statsd monitoring.

### statsd\_prefix

ENV: <b>TYK\_GW\_STATSDPREFIX</b><br />
Type: `string`<br />

StatsD prefix

### event\_handlers

ENV: <b>TYK\_GW\_EVENTHANDLERS</b><br />
Type: `apidef.EventHandlerMetaConfig`<br />

Event System

### hide\_generator\_header

ENV: <b>TYK\_GW\_HIDEGENERATORHEADER</b><br />
Type: `bool`<br />

HideGeneratorHeader will mask the 'X-Generator' and 'X-Mascot-...' headers, if set to true.

### force\_global\_session\_lifetime

ENV: <b>TYK\_GW\_FORCEGLOBALSESSIONLIFETIME</b><br />
Type: `bool`<br />

Enable global API token expiration. Can be needed if all your APIs using JWT or oAuth 2.0 auth methods with dynamically generated keys.

### session\_lifetime\_respects\_key\_expiration

ENV: <b>TYK\_GW\_SESSIONLIFETIMERESPECTSKEYEXPIRATION</b><br />
Type: `bool`<br />

SessionLifetimeRespectsKeyExpiration respects the key expiration time when the session lifetime is less than the key expiration. That is, Redis waits the key expiration for physical removal.

### global\_session\_lifetime

ENV: <b>TYK\_GW\_GLOBALSESSIONLIFETIME</b><br />
Type: `int64`<br />

global session lifetime, in seconds.

### kv.KV

ENV: <b>TYK\_GW\_KV\_KV</b><br />
Type: `struct`<br />

See more details [https://tyk.io/docs/tyk-self-managed/#store-configuration-with-key-value-store](https://tyk.io/docs/tyk-self-managed/#store-configuration-with-key-value-store)

### kv.consul.address

ENV: <b>TYK\_GW\_KV\_CONSUL\_ADDRESS</b><br />
Type: `string`<br />

Address is the address of the Consul server

### kv.consul.scheme

ENV: <b>TYK\_GW\_KV\_CONSUL\_SCHEME</b><br />
Type: `string`<br />

Scheme is the URI scheme for the Consul server

### kv.consul.datacenter

ENV: <b>TYK\_GW\_KV\_CONSUL\_DATACENTER</b><br />
Type: `string`<br />

The datacenter to use. If not provided, the default agent datacenter is used.

### kv.consul.http\_auth.username

ENV: <b>TYK\_GW\_KV\_CONSUL\_HTTPAUTH\_USERNAME</b><br />
Type: `string`<br />

Username to use for HTTP Basic Authentication

### kv.consul.http\_auth.password

ENV: <b>TYK\_GW\_KV\_CONSUL\_HTTPAUTH\_PASSWORD</b><br />
Type: `string`<br />

Password to use for HTTP Basic Authentication

### kv.consul.tls\_config.address

ENV: <b>TYK\_GW\_KV\_CONSUL\_TLSCONFIG\_ADDRESS</b><br />
Type: `string`<br />

Address

### kv.consul.tls\_config.ca\_file

ENV: <b>TYK\_GW\_KV\_CONSUL\_TLSCONFIG\_CAFILE</b><br />
Type: `string`<br />

CA file

### kv.consul.tls\_config.ca\_path

ENV: <b>TYK\_GW\_KV\_CONSUL\_TLSCONFIG\_CAPATH</b><br />
Type: `string`<br />

CA Path

### kv.consul.tls\_config.cert\_file

ENV: <b>TYK\_GW\_KV\_CONSUL\_TLSCONFIG\_CERTFILE</b><br />
Type: `string`<br />

Cert file

### kv.consul.tls\_config.key\_file

ENV: <b>TYK\_GW\_KV\_CONSUL\_TLSCONFIG\_KEYFILE</b><br />
Type: `string`<br />

Key file

### kv.consul.tls\_config.insecure\_skip\_verify

ENV: <b>TYK\_GW\_KV\_CONSUL\_TLSCONFIG\_INSECURESKIPVERIFY</b><br />
Type: `bool`<br />

Disable TLS validation

### kv.vault.token

ENV: <b>TYK\_GW\_KV\_VAULT\_TOKEN</b><br />
Type: `string`<br />

Token is the vault root token

### kv.vault.kv\_version

ENV: <b>TYK\_GW\_KV\_VAULT\_KVVERSION</b><br />
Type: `int`<br />

KVVersion is the version number of Vault. Usually defaults to 2

### secrets

ENV: <b>TYK\_GW\_SECRETS</b><br />
Type: `map[string]string`<br />

Secrets configures a list of key/value pairs for the gateway.
When configuring it via environment variable, the expected value
is a comma separated list of key-value pairs delimited with a colon.

Example: `TYK_GW_SECRETS=key1:value1,key2:/value2`
Produces: `{"key1": "value1", "key2": "/value2"}`

The secret value may be used as `secrets://key1` from the API definition.
In versions before gateway 5.3, only `listen_path` and `target_url` fields
have had the secrets replaced.
See more details [https://tyk.io/docs/tyk-self-managed/#how-to-access-the-externally-stored-data](https://tyk.io/docs/tyk-self-managed/#how-to-access-the-externally-stored-data)

### override\_messages

Override the default error code and or message returned by middleware.
The following message IDs can be used to override the message and error codes:

AuthToken message IDs

* `auth.auth_field_missing`
* `auth.key_not_found`

OIDC message IDs

* `oauth.auth_field_missing`
* `oauth.auth_field_malformed`
* `oauth.key_not_found`
* `oauth.client_deleted`

Sample Override Message Setting

```
"override_messages": {
  "oauth.auth_field_missing" : {
   "code": 401,
   "message": "Token is not authorized"
 }
}
```

### cloud

ENV: <b>TYK\_GW\_CLOUD</b><br />
Type: `bool`<br />

Cloud flag shows the Gateway runs in Tyk Cloud.

### jwt\_ssl\_insecure\_skip\_verify

ENV: <b>TYK\_GW\_JWTSSLINSECURESKIPVERIFY</b><br />
Type: `bool`<br />

Skip TLS verification for JWT JWKs url validation

### resource\_sync

ResourceSync configures mitigation strategy in case sync fails.

### resource\_sync.retry\_attempts

ENV: <b>TYK\_GW\_RESOURCESYNC\_RETRYATTEMPTS</b><br />
Type: `int`<br />

RetryAttempts defines the number of retries that the Gateway
should perform during a resource sync (APIs or policies), defaulting
to zero which means no retries are attempted.

### resource\_sync.interval

ENV: <b>TYK\_GW\_RESOURCESYNC\_INTERVAL</b><br />
Type: `int`<br />

Interval configures the interval in seconds between each retry on a resource sync error.

### oas\_config

OAS holds the configuration for various OpenAPI-specific functionalities

### oas\_config.validate\_examples

ENV: <b>TYK\_GW\_OAS\_VALIDATEEXAMPLES</b><br />
Type: `bool`<br />

ValidateExamples enables validation of values provided in `example` and `examples` fields against the declared schemas in the OpenAPI Document. Defaults to false.

### oas\_config.validate\_schema\_defaults

ENV: <b>TYK\_GW\_OAS\_VALIDATESCHEMADEFAULTS</b><br />
Type: `bool`<br />

ValidateSchemaDefaults enables validation of values provided in `default` fields against the declared schemas in the OpenAPI Document. Defaults to false.

### streaming

Streaming holds the configuration for Tyk Streaming functionalities

### streaming.enabled

ENV: <b>TYK\_GW\_STREAMING\_ENABLED</b><br />
Type: `bool`<br />

This flag enables the Tyk Streaming feature.

### streaming.allow\_unsafe

ENV: <b>TYK\_GW\_STREAMING\_ALLOWUNSAFE</b><br />
Type: `[]string`<br />

AllowUnsafe specifies a list of potentially unsafe streaming components that should be allowed in the configuration.
By default, components that could pose security risks (like file access, subprocess execution, socket operations, etc.)
are filtered out. This field allows administrators to explicitly permit specific unsafe components when needed.
Use with caution as enabling unsafe components may introduce security vulnerabilities.

### jwks

JWKS holds the configuration for Tyk JWKS functionalities

### jwks.cache

Cache holds configuration for JWKS caching

### jwks.cache.timeout

ENV: <b>TYK\_GW\_JWKS\_CACHE\_TIMEOUT</b><br />
Type: `int64`<br />

Timeout defines how long the JWKS will be kept in the cache before forcing a refresh from the JWKS endpoint.
Default is 240 seconds (4 minutes). Set to 0 to use the default value.
