Skip to content

Commit a2ae075

Browse files
update nginx config doc (#966)
1 parent 51d0eb4 commit a2ae075

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

docs/get-started/self-host/external-access.mdx

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,17 @@ http {
3737
ssl_certificate_key /path/to/private/key/file;
3838
3939
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
4142
proxy_http_version 1.1;
4243
# Enables WebSocket which is required for SQL Editor autocomplete
4344
proxy_set_header Upgrade $http_upgrade;
4445
proxy_set_header Connection $connection_upgrade;
4546
}
4647
4748
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
4951
}
5052
5153
proxy_read_timeout 3600;
@@ -54,6 +56,20 @@ http {
5456
}
5557
```
5658

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+
5773
### Caddy Configuration
5874

5975
For Docker deployments using Caddy (automatic HTTPS with Let's Encrypt):
@@ -74,6 +90,7 @@ bytebase.example.com {
7490
```
7591

7692
To use this Caddy configuration:
93+
7794
1. Install Caddy on your VM
7895
2. Save the configuration to `/etc/caddy/Caddyfile`
7996
3. Run: `caddy reload`
@@ -196,11 +213,12 @@ For production usage, configure the External URL to match your domain. See [Conf
196213
### WebSocket Support
197214
198215
SQL Editor autocomplete requires WebSocket support. All configurations above include the necessary WebSocket settings. Key endpoints that require WebSocket:
216+
199217
- `/v1:adminExecute` - For SQL execution
200218
- `/lsp` - For Language Server Protocol (autocomplete)
201219

202220
### Troubleshooting
203221

204222
- **WebSocket issues**: Verify proxy/ingress WebSocket configuration
205223
- **502 errors**: Check Bytebase service status
206-
- **Timeout errors**: Increase proxy timeout settings (see examples above)
224+
- **Timeout errors**: Increase proxy timeout settings (see examples above)

0 commit comments

Comments
 (0)