Repository navigation
Expand file tree
/
Copy pathnginx-dashboard.conf
More file actions
57 lines (50 loc) · 3.77 KB
/
Copy pathnginx-dashboard.conf
File metadata and controls
57 lines (50 loc) · 3.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Example nginx reverse proxy for the GitHub Agent Bridge dashboard.
#
# Replace bridge.example.com with the public dashboard hostname. The upstream
# stays loopback-only because GitHub OAuth and dashboard authorization live in
# the FastAPI service.
server {
listen 443 ssl http2;
server_name bridge.example.com;
# ssl_certificate /etc/letsencrypt/live/bridge.example.com/fullchain.pem;
# ssl_certificate_key /etc/letsencrypt/live/bridge.example.com/privkey.pem;
# Keep webhook ingestion independent from dashboard/UI restarts. systemd
# owns this socket and queues short bursts while the ingress process swaps.
location = /api/webhooks/github {
# Keep this aligned with GITHUB_AGENT_BRIDGE_WEBHOOK_MAX_BYTES. nginx
# rejects oversized bodies before proxy buffering or Python allocation.
client_max_body_size 1m;
proxy_pass http://127.0.0.1:8766;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_connect_timeout 5s;
proxy_read_timeout 30s;
proxy_send_timeout 30s;
}
location / {
proxy_pass http://127.0.0.1:8765;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Required for live dashboard logs and journal streams.
proxy_buffering off;
proxy_cache off;
proxy_read_timeout 1h;
# During dashboard service restarts, show a small retry page instead of
# nginx's generic "Bad Gateway" response.
proxy_intercept_errors on;
error_page 502 503 504 = @dashboard_restarting;
}
location @dashboard_restarting {
internal;
default_type text/html;
add_header Cache-Control "no-store" always;
add_header Retry-After "5" always;
return 503 '<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><meta http-equiv="refresh" content="5"><title>Dashboard restarting</title><style>:root{color-scheme:light dark;font-family:system-ui,sans-serif}body{margin:0;min-height:100vh;display:grid;place-items:center;background:#f6f7f9;color:#1f2937}main{max-width:34rem;padding:2rem;text-align:center}.loader{--color-1:#fff;--color-2:#0d161b;--size:1px;position:relative;width:calc(108 * var(--size));display:flex;justify-content:space-between;margin:0 auto 1.5rem}.loader:after,.loader:before{content:"";display:inline-block;width:calc(48 * var(--size));height:calc(48 * var(--size));background-color:var(--color-1);background-image:radial-gradient(circle calc(14 * var(--size)),var(--color-2) 100%,transparent 0);background-repeat:no-repeat;border-radius:50%;animation:eyeMove 10s infinite,blink 10s infinite}@keyframes eyeMove{0%,10%{background-position:0 0}13%,40%{background-position:calc(-15 * var(--size)) 0}43%,70%{background-position:calc(15 * var(--size)) 0}73%,90%{background-position:0 calc(15 * var(--size))}93%,100%{background-position:0 0}}@keyframes blink{0%,10%,12%,20%,22%,40%,42%,60%,62%,70%,72%,90%,92%,98%,100%{height:calc(48 * var(--size))}11%,21%,41%,61%,71%,91%,99%{height:calc(18 * var(--size))}}h1{margin:0 0 .75rem;font-size:1.5rem}p{margin:0;line-height:1.5;color:#4b5563}@media(prefers-color-scheme:dark){body{background:#111827;color:#f9fafb}p{color:#d1d5db}}</style></head><body><main><div class="loader" aria-hidden="true"></div><h1>Dashboard restarting</h1><p>The bridge dashboard is applying a restart. This page will retry automatically.</p></main></body></html>';
}
}