Warning
This translation was modified on 1 April 2023 and an updated version (9 April 2025) is available on the source page. View the original page
Environment Variables
Xray provides the following environment variables for modifying some of its underlying configurations.
Xray Asset Location
- Name:
xray.location.assetorXRAY_LOCATION_ASSET。 - Default value:specified FHS directory or the same path as the Xray file.
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 search for resource files in the following order:
./
/usr/local/share/xray
/usr/share/xray
Configuration File Location
- Name:
xray.location.configorXRAY_LOCATION_CONFIG。 - Default value: Same path as the Xray file.
This environment variable specifies a folder location that should contain the config.json file.
Multiple Configuration Directories
- Name:
xray.location.confdirorXRAY_LOCATION_CONFDIR。 - Default value:
""。
The .json files in this directory will be read in alphabetical order by filename and used as options for multiple configurations.