You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -22,49 +25,72 @@ Souin is a new cache system suitable for every reverse-proxy. It will be placed
22
25
As it's written in go, it can be deployed on any server and thanks to the docker integration, it will be easy to install on top of a Swarm or a kubernetes instance.
23
26
24
27
## Configuration
25
-
The configuration file is stored at `configuration/configuration.yml`. You can edit it provided you fill at least the required parameters as shown below.
28
+
The configuration file is stored at `/anywhere/configuration.yml`. You can edit it provided you fill at least the required parameters as shown below.
26
29
27
30
### Required configuration
28
31
```yaml
29
-
ttl: 100#TTL in second
30
-
reverse_proxy_url: 'http://traefik'# The reverse-proxy http address
31
-
cache:
32
-
port:
32
+
default_cache: # Required part
33
+
port: # Ports to expose Souin
33
34
web: 80
34
35
tls: 443
36
+
ttl: 10# Default TTL
37
+
reverse_proxy_url: 'http://traefik'# If it's in the same network you can use http://your-service. Then just use https://yourdomain.com
35
38
```
36
39
This is a fully working minimal configuration for a Souin instance
url: 'redis:6379' # Redis http address, only used for redis provider
48
-
regex:
49
-
exclude: 'ARegexHere'
50
-
ssl_providers: # Must match your volumes to /ssl/{provider}.json
49
+
# /anywhere/configuration.yml
50
+
default_cache:
51
+
headers: # Default headers concatenated in stored keys
52
+
- Authorization
53
+
providers:
54
+
- all # Enable all providers by default
55
+
redis: # Redis configuration
56
+
url: 'redis:6379'
57
+
regex:
58
+
exclude: 'ARegexHere' # Regex to exclude from cache
59
+
ssl_providers: # The {providers}.json to use
51
60
- traefik
52
-
cache:
53
-
headers:
54
-
- Authorization # Can be any other headers
55
-
providers: # By default it will use in-memory and redis cache. It can be either `all`, `redis` or `memory`.
56
-
- all # Can be set to all if you want to enable all providers instead of specifying each one
57
-
# - memory
58
-
# - redis
61
+
urls:
62
+
'https:\/\/domain.com\/first-.+': # First regex route configuration
63
+
ttl: 1000 # Override default TTL
64
+
providers: # Providers list (each item must be in default providers list)
65
+
- redis
66
+
- memory
67
+
- ristretto
68
+
'https:\/\/domain.com\/second-route': # Second regex route configuration
69
+
ttl: 10 # Override default TTL
70
+
headers: # Override default headers
71
+
- Authorization
72
+
providers: # Providers list (each item must be in default providers list)
73
+
- memory
74
+
'https?:\/\/mysubdomain\.domain\.com': # Third regex route configuration
75
+
ttl: 50
76
+
headers: # Override default headers
77
+
- Authorization
78
+
- 'Content-Type'
79
+
providers: # Providers list (each item must be in default providers list)
80
+
- redis
59
81
```
60
82
61
83
| Key | Description | Value example |
62
84
|:---:|:---:|:---:|
63
-
|`redis.url`|The redis url, used if you enabled it in the provider section|`redis:6379` (container way) and `http://yourdomain.com:6379` (network way)|
64
-
|`regex.exclude`|The regex used to prevent paths being cached|`^[A-z]+.*$`|
85
+
|`default_cache.headers`|List of headers to include to the cache|`- Authorization`<br/><br/>`- Content-Type`<br/><br/>`- X-Additional-Header`|
86
+
|`default_cache.providers`|Your providers list to cache your data, by default it will use all systems|`- all`<br/><br/>`- memory`<br/><br/>`- redis`|
87
+
|`default_cache.redis.url`|The redis url, used if you enabled it in the provider section|`redis:6379` (container way) and `http://yourdomain.com:6379` (network way)|
88
+
|`default_cache.regex.exclude`|The regex used to prevent paths being cached|`^[A-z]+.*$`|
65
89
|`ssl_providers`|List of your providers handling certificates|`- traefik`<br/><br/>`- nginx`<br/><br/>`- apache`|
66
-
|`cache.headers`|List of headers to include to the cache|`- Authorization`<br/><br/>`- Content-Type`<br/><br/>`- X-Additional-Header`|
67
-
|`cache.providers`|Your providers list to cache your data, by default it will use all systems|`- all`<br/><br/>`- memory`<br/><br/>`- redis`|
90
+
|`urls.{your url or regex}`|List of your custom configuration depending each URL or regex|'https:\/\/yourdomain.com'|
91
+
|`urls.{your url or regex}.ttl`|Override the default TTL if defined|99999|
92
+
|`urls.{your url or regex}.headers`|Override the default headers if defined|`- Authorization`<br/><br/>`- 'Content-Type'`|
93
+
|`urls.{your url or regex}.providers`|Override the default providers if defined|`- redis`<br/><br/>`- ristretto`|
0 commit comments