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
Copy file name to clipboardExpand all lines: README.md
+14-5Lines changed: 14 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,22 +30,29 @@ services:
30
30
- "80:80"
31
31
environment:
32
32
- UPSTREAM_SERVER=owl:8080 # For production with owl service
33
-
- CACHE_MAX_SIZE=1000g # 1TB cache size for high-traffic deployments
33
+
- CACHE_MAX_SIZE=1t # 1TB cache size for high-traffic deployments
34
+
- DNS_RESOLVER=169.254.169.250 # Rancher internal DNS (check /etc/resolv.conf)
34
35
```
35
36
36
37
### Health Check
37
38
38
39
```bash
39
40
curl http://localhost/health
40
-
# Returns: OK
41
+
# Returns: upstream response or "UPSTREAM_UNAVAILABLE" (503) if upstream is down
42
+
# Includes X-Upstream-Status header showing actual upstream response code
41
43
```
42
44
45
+
The health endpoint now proxies to the upstream server to verify connectivity. If the upstream is unavailable, it returns 503 with "UPSTREAM_UNAVAILABLE".
46
+
47
+
**Health Monitoring**: A background process logs warnings every 5 minutes if the upstream server becomes unreachable, but the container continues running to serve cached content.
48
+
43
49
## Configuration
44
50
45
51
### Environment Variables
46
52
47
53
-`UPSTREAM_SERVER`: Backend server URL (default: `owl.virtualflybrain.org:80`)
48
-
-`CACHE_MAX_SIZE`: Maximum cache size on disk (default: `20g`, accepts NGINX size units: `k`/`K` kilobytes, `m`/`M` megabytes, `g`/`G` gigabytes)
54
+
-`CACHE_MAX_SIZE`: Maximum cache size on disk (default: `20g`, accepts NGINX size units like `1t` for 1TB)
55
+
-`DNS_RESOLVER`: DNS resolver servers (default: `8.8.8.8 1.1.1.1`, space-separated list). Check `cat /etc/resolv.conf` in your container to find the correct value for your environment.
49
56
50
57
### Cache Headers
51
58
@@ -69,7 +76,8 @@ The proxy adds helpful headers to responses:
69
76
-**Base image**: nginx:1.26-alpine
70
77
-**Cache storage**: `/var/cache/nginx/owlery` with 1:2 directory levels
71
78
-**Cache zone**: 100MB in-memory metadata zone
72
-
-**Max cache size**: 20GB on disk (configurable via `CACHE_MAX_SIZE` environment variable, supports k/K, m/M, g/G units)
79
+
-**Max cache size**: 20GB on disk (configurable via `CACHE_MAX_SIZE` environment variable)
80
+
-**Health monitoring**: Background process checks upstream connectivity every 5 minutes and logs warnings
73
81
74
82
### Caching Behavior
75
83
@@ -83,9 +91,10 @@ The proxy adds helpful headers to responses:
83
91
### Networking
84
92
85
93
-**Listen port**: 80
94
+
-**DNS resolver**: Configurable via `DNS_RESOLVER` (default: Google Public DNS with 30s TTL for fast upstream IP updates). Check `cat /etc/resolv.conf` in your container for the correct value.
86
95
-**Host-agnostic**: Ignores Host header for routing
87
96
-**Connection pooling**: 16 keep-alive connections to backend
88
-
-**Timeouts**: 90s connect/read/send
97
+
-**Timeouts**: 90s connect/read/send, 3s for health checks
0 commit comments