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: docs/get-started/self-host/external-access.mdx
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,15 +37,17 @@ http {
37
37
ssl_certificate_key /path/to/private/key/file;
38
38
39
39
location ~ ^/(v1:adminExecute|lsp) {
40
-
proxy_pass http://bytebase.example.com;
40
+
# Point to the actual Bytebase service, NOT the nginx domain
41
+
proxy_pass http://127.0.0.1:8080; # If Bytebase runs on the same host
41
42
proxy_http_version 1.1;
42
43
# Enables WebSocket which is required for SQL Editor autocomplete
43
44
proxy_set_header Upgrade $http_upgrade;
44
45
proxy_set_header Connection $connection_upgrade;
45
46
}
46
47
47
48
location / {
48
-
proxy_pass http://bytebase.example.com;
49
+
# Point to the actual Bytebase service, NOT the nginx domain
50
+
proxy_pass http://127.0.0.1:8080; # If Bytebase runs on the same host
49
51
}
50
52
51
53
proxy_read_timeout 3600;
@@ -54,6 +56,20 @@ http {
54
56
}
55
57
```
56
58
59
+
#### Common Issue: 502 Bad Gateway
60
+
61
+
If you're getting 502 errors, ensure `proxy_pass` points to the actual Bytebase service, not the nginx domain itself (which creates a loop):
62
+
63
+
```nginx
64
+
# ❌ WRONG - Creates proxy loop
65
+
proxy_pass http://bytebase.example.com;
66
+
67
+
# ✅ CORRECT - Points to Bytebase service
68
+
proxy_pass http://127.0.0.1:8080; # Same host
69
+
proxy_pass http://bytebase:8080; # Docker Compose service name
70
+
proxy_pass http://10.0.0.5:8080; # Different host IP
71
+
```
72
+
57
73
### Caddy Configuration
58
74
59
75
For Docker deployments using Caddy (automatic HTTPS with Let's Encrypt):
@@ -74,6 +90,7 @@ bytebase.example.com {
74
90
```
75
91
76
92
To use this Caddy configuration:
93
+
77
94
1. Install Caddy on your VM
78
95
2. Save the configuration to `/etc/caddy/Caddyfile`
79
96
3. Run: `caddy reload`
@@ -196,11 +213,12 @@ For production usage, configure the External URL to match your domain. See [Conf
196
213
### WebSocket Support
197
214
198
215
SQL Editor autocomplete requires WebSocket support. All configurations above include the necessary WebSocket settings. Key endpoints that require WebSocket:
216
+
199
217
- `/v1:adminExecute` - For SQL execution
200
218
- `/lsp`- For Language Server Protocol (autocomplete)
0 commit comments