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",
{
"MatchingPath": "/example/",
"Domain": "example.com",
"RequireTLS": true, "RequireTLS": true,
"BypassGlobalTLS": true,
"SkipCertValidations": false, "SkipCertValidations": false,
"Disabled": false "SkipWebSocketOriginCheck": true,
}, "VirtualDirectories": [
{ {
"MatchingPath": "/teacat/", "MatchingPath": "/teacat/",
"Domain": "sorae.co", "Domain": "sorae.co",
"RequireTLS": true, "RequireTLS": true,
"SkipCertValidations": false, "SkipCertValidations": false,
"Disabled": false "Disabled": false
},
{
"MatchingPath": "/imus/",
"Domain": "imuslab.com",
"RequireTLS": true,
"SkipCertValidations": true,
"Disabled": false
} }
], ],
"UserDefinedHeaders": [ "UserDefinedHeaders": [
{ {
"Key": "X-Special-Header", "Key": "X-Custom-Header",
"Value": "foo=bar" "Value": "foo,bar"
} }
], ],
"RequireBasicAuth": false, "RequireBasicAuth": false,
"BasicAuthCredentials": [ "BasicAuthCredentials": [
{ {
"Username": "USERNAME", "Username": "test",
"PasswordHash": "PASSWORD_HASH_HERE" "PasswordHash": "PASSWORD_SHA512_HASH_HERE"
},
{
"Username": "user",
"PasswordHash": "PASSWORD_SHA512_HASH_HERE"
} }
], ],
"BasicAuthExceptionRules": [ "BasicAuthExceptionRules": [
{ {
"PathPrefix": "/public/api/" "PathPrefix": "/public/api"
} }
], ],
"AccessFilterUUID": "default",
"Disabled": false,
"DefaultSiteOption": 0, "DefaultSiteOption": 0,
"DefaultSiteValue": "", "DefaultSiteValue": ""
"Disabled": false
} }
``` ```
@ -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