SQL configuration is used when default rules are not enough and a more complex setup is required
For complete information about tables you can view the table schema.
Columns not used by WebCDN are not listed here. They may be used by helper systems for tagging etc..
Reloading WebCDN is done by sending a USR1 signal to its main proces.


Certificates

Certificates from the certificate service can be configured in table certificate. Only column domain and secret is used by WebCDN.
You don't need to map a certificate to a hostname or policy.
The PKCS12 certificate files are cached to the same folder as certificates from the config file.


Request lookup

A HTTP request is first matched against table policy. Then table backend is used via table policy_backend and a response is sent.


Policy table

Lookup table per client request. Can also be used by a backend for further filtering.
The policy entry matching the request info will be used when handling the response, ordered by highest length of host and allow

ColumnValuesDescription
ID
primary key
parent_id
Parent policy ID if nested policies are used
hostFQDN - fully qualified domain name
Will also match for all child sub domains.
If value is "com" and the request was for example.com, the row will match

tls0 - any
1 - TLS not used
2 - TLS used
3 - Do redirect to TLS if not used
TLS connection requirement
ctype_mainBlank or valueThe main part of the content type in the response
ctype_subBlank or valueThe secondary part of the content type in the response
type0 - any
1 - GET
2 - POST
...

Request type, defined by jhttp HEADER_REQUEST_TYPE
allow0, 1Should the policy be allowed or not. Used for ordering. Allow=0 comes before allow=1 in order.
classification0 - any
4 - trusted client (allow more information or config)
Used in responses and backends to return different content
cache_mode0 - disabled
1 - dynamic content - strict caching only. Static content - caching enabled
2 - dynamic content - cache if no cookies are used by backend
3 - max cache regardless of cookies
Default 1 hour cached for dynamic pages. 1 day for static files
Maxage set by backends and worker script engines overrides default
Cookies starting with _ are dropped by server. More cookies can be dropped by filter
captcha_mode0 - disabled
1 - enabled
2 - smart mode. Enabled for certain login pages
3 - enabled depending on url path level and parameter count 

redirecturl_ondownURLIf all backends are unhealthy, send redirect to this url



Policy_backend table

Mapping table for policy to backend with a matching patch

ColumnValuesDescription
ID
primary key
policy_id
Policy ID
backend_id
Backend ID
pathNULL or /path/from/urlDifferent paths can be mapped to different backends.


Backend table

Response backends processing the actual request
Frontend CDN with backend uses backend 0 (host)
Normal web server mode with local CDN uses backend 1 (local)


Column
Values
Description
ID

primary key
Type
0 - host proxy
1 - local engine
2 - redirect

address

Host - hostname
Local - path to web root
port

Host - port
Local - if set to 1, add requested host name to web root. If folder does not exist, use folder any
data

Host - Use this value as hostname in http request instead of address
Local - Script engine
tls
0 - unspecified
1 - no TLS
2 - use TLS
3 - use TLS and verify CA
Host - TLS connection to remote
cache_mode

Overrides policy cache_mode if set
waf
analytics
authenticate
redirect
Module to run before backend is processed
health_mode
0 - normal mode
1- never fail
Used by host backend. Skip backend if it previously failed. Resume using it when it reports healthy again.


Context table

If used is authenticated, you can use different context instead of the default context 0.
This table does not currendly hold config


Access table

Permission mapping between JID account_id and group_id to a context_id