Updated v3.0.2 config file template

Toby Chui 2024-04-25 20:57:28 +08:00
parent 4f681a3d53
commit 338b29135c

@ -1,51 +1,61 @@
Other than editing routing in the web UI, you can also create a config file and let Zoraxy load it on startup. You can put your config file under ```conf/proxy/``` as JSON file with file extension ".config". For example, here is an example of `(ST).test.localhost.config` Other than editing routing in the web UI, you can also create a config file and let Zoraxy load it on startup. You can put your config file under ```conf/proxy/``` as JSON file with file extension ".config". For example, here is an example of `(ST).test.localhost.config`
**This config structure is for Zoraxy v3 only** **This config structure is for Zoraxy v3.0.2 or above**
```json ```json
{ {
"ProxyType": 1, "ProxyType": 1,
"RootOrMatchingDomain": "*.test.yourdomain.com", "RootOrMatchingDomain": "a.example.com",
"Domain": "192.168.1.100:8080", "MatchingDomainAlias": [
"RequireTLS": false, "b.example.com",
"BypassGlobalTLS": true, "c.example.com"
"SkipCertValidations": true, ],
"VirtualDirectories": [ "Domain": "target.example.com",
{ "RequireTLS": true,
"MatchingPath": "/example/", "BypassGlobalTLS": true,
"Domain": "example.com", "SkipCertValidations": false,
"RequireTLS": true, "SkipWebSocketOriginCheck": true,
"SkipCertValidations": false, "VirtualDirectories": [
"Disabled": false {
}, "MatchingPath": "/teacat/",
{ "Domain": "sorae.co",
"MatchingPath": "/teacat/", "RequireTLS": true,
"Domain": "sorae.co", "SkipCertValidations": false,
"RequireTLS": true, "Disabled": false
"SkipCertValidations": false, },
"Disabled": false {
} "MatchingPath": "/imus/",
], "Domain": "imuslab.com",
"UserDefinedHeaders": [ "RequireTLS": true,
{ "SkipCertValidations": true,
"Key": "X-Special-Header", "Disabled": false
"Value": "foo=bar" }
} ],
], "UserDefinedHeaders": [
"RequireBasicAuth": false, {
"BasicAuthCredentials": [ "Key": "X-Custom-Header",
{ "Value": "foo,bar"
"Username": "USERNAME", }
"PasswordHash": "PASSWORD_HASH_HERE" ],
} "RequireBasicAuth": false,
], "BasicAuthCredentials": [
"BasicAuthExceptionRules": [ {
{ "Username": "test",
"PathPrefix": "/public/api/" "PasswordHash": "PASSWORD_SHA512_HASH_HERE"
} },
], {
"DefaultSiteOption": 0, "Username": "user",
"DefaultSiteValue": "", "PasswordHash": "PASSWORD_SHA512_HASH_HERE"
"Disabled": false }
],
"BasicAuthExceptionRules": [
{
"PathPrefix": "/public/api"
}
],
"AccessFilterUUID": "default",
"Disabled": false,
"DefaultSiteOption": 0,
"DefaultSiteValue": ""
} }
``` ```
@ -75,4 +85,5 @@ Here are some key items for the proxy config
- RequireTLS: Proxy target require TLS (https) connection - RequireTLS: Proxy target require TLS (https) connection
- BypassGlobalTLS: Allow this rules to be accessed via port 80 endpoint (if enabled) - BypassGlobalTLS: Allow this rules to be accessed via port 80 endpoint (if enabled)
- SkipCertValidations: Skip proxy target TLS error, for self sign certificate - SkipCertValidations: Skip proxy target TLS error, for self sign certificate
- SkipWebSocketOriginCheck: Skip websocket origin check, default enable and usually won't cause any security issues
- AccessFilterUUID: The ID of the access rule filter used, must be matching with the "ID" field inside the access config file