Files
XTLS_Xray-docs-next/docs/en/config/features/env.md
T

1.9 KiB

Environment Variables

Xray provides the following environment variables to modify some underlying configurations of Xray.

Resource File Path

  • Name: xray.location.asset or XRAY_LOCATION_ASSET.
  • Default value: Specific FHS directories or the same path as the Xray executable.

This environment variable specifies a folder location that should contain the geoip.dat and geosite.dat files. If no variable value is specified, the program will look for resource files in the following order:

./
/usr/local/share/xray
/usr/share/xray

Configuration File Location

  • Name: xray.location.config or XRAY_LOCATION_CONFIG.
  • Default value: The same path as the Xray executable.

This environment variable specifies a folder location that should contain the config.json file.

Multiple Configuration Directory

  • Name: xray.location.confdir or XRAY_LOCATION_CONFDIR.
  • Default value: "".

The .json files in this directory will be read in alphabetical order of their filenames as multiple configuration options.

This item has lower priority than the startup argument confdir.

Strict JSON Parser

  • Name: xray.json.strict or XRAY_JSON_STRICT.
  • Default value: false.

By default, on startup Xray uses a custom JSON parser that strips comments and other non-standard characters from the configuration. If you are sure that your configuration file strictly conforms to the JSON standard (RFC 8259), you can enable this option to use the standard JSON parser, which is faster when working with large configurations.

Other Available Configurations

  • xray.location.plugin

  • xray.location.tool

  • xray.location.cert

  • xray.buf.readv

  • xray.buf.splice

  • xray.vmess.padding

  • xray.ray.buffer.size

  • xray.browser.dialer

  • xray.xudp.show

  • xray.xudp.basekey

These options are open to users with special needs; you can read the source code to discover their usage. PR Welcome