Skip to content

Commit 6b6b2c6

Browse files
committed
Remove reverse proxy requirement from BlazeGraph guide
The proxy server now preserves URL paths, so users can connect directly to BlazeGraph's SPARQL endpoint without nginx in between.
1 parent 5658199 commit 6b6b2c6

1 file changed

Lines changed: 24 additions & 52 deletions

File tree

docs/guides/connecting-to-blazegraph.md

Lines changed: 24 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -20,57 +20,31 @@ You can verify BlazeGraph is running by visiting `http://localhost:9999/blazegra
2020

2121
## Connecting Graph Explorer
2222

23-
Graph Explorer's proxy server expects the SPARQL endpoint at `/sparql` on the database host, but BlazeGraph serves it at `/blazegraph/namespace/<ns>/sparql`. To bridge this gap, you need a reverse proxy (such as nginx) in front of BlazeGraph that rewrites the path.
24-
25-
### Setting Up the Reverse Proxy
26-
27-
Create an `nginx.conf` file:
28-
29-
```nginx
30-
events {}
31-
http {
32-
server {
33-
listen 8080;
34-
location /sparql {
35-
proxy_pass http://blazegraph:9999/blazegraph/namespace/kb/sparql;
36-
}
37-
}
38-
}
39-
```
40-
41-
> [!NOTE]
42-
>
43-
> The default namespace in BlazeGraph is `kb`. If you created a custom namespace, replace `kb` with your namespace name in the `proxy_pass` URL.
44-
45-
Then run nginx alongside BlazeGraph on a shared Docker network:
46-
47-
```
48-
docker network create graph-net
49-
docker run -d -p 9999:9999 --name blazegraph --network graph-net lyrasis/blazegraph:2.1.5
50-
docker run -d --name blazegraph-proxy --network graph-net -p 8080:8080 -v ./nginx.conf:/etc/nginx/nginx.conf:ro nginx:stable-alpine
51-
```
52-
53-
### Connection Settings
54-
5523
Open Graph Explorer and add a new connection with the following settings:
5624

5725
- Name: `BlazeGraph`
5826
- Query Language: `SPARQL`
5927
- Public or Proxy Endpoint: `https://localhost`
6028
- Using Proxy Server: `true`
61-
- Graph Connection URL: `http://blazegraph-proxy:8080`
29+
- Graph Connection URL: `http://localhost:9999/blazegraph/namespace/kb/sparql`
6230

63-
| Setting | Description |
64-
| ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------- |
65-
| **Public or Proxy Endpoint** | The URL where Graph Explorer is accessible in your browser. |
66-
| **Using Proxy Server** | Enables the Graph Explorer proxy server, which forwards requests to the database. |
67-
| **Graph Connection URL** | The URL the proxy server uses to reach the database. Points to the nginx reverse proxy, which rewrites the path for BlazeGraph. |
31+
| Setting | Description |
32+
| ---------------------------- | --------------------------------------------------------------------------------- |
33+
| **Public or Proxy Endpoint** | The URL where Graph Explorer is accessible in your browser. |
34+
| **Using Proxy Server** | Enables the Graph Explorer proxy server, which forwards requests to the database. |
35+
| **Graph Connection URL** | The full URL to the BlazeGraph SPARQL endpoint, including the namespace path. |
36+
37+
> [!NOTE]
38+
>
39+
> The default namespace in BlazeGraph is `kb`. If you created a custom namespace, replace `kb` with your namespace name in the Graph Connection URL.
6840
6941
## Running Graph Explorer with Docker
7042

71-
If Graph Explorer is also running as a Docker container, it needs to be on the same network:
43+
If Graph Explorer is also running as a Docker container, it needs to be on the same network as BlazeGraph:
7244

7345
```
46+
docker network create graph-net
47+
docker run -d -p 9999:9999 --name blazegraph --network graph-net lyrasis/blazegraph:2.1.5
7448
docker run -p 80:80 -p 443:443 \
7549
--name graph-explorer \
7650
--network graph-net \
@@ -79,32 +53,30 @@ docker run -p 80:80 -p 443:443 \
7953
public.ecr.aws/neptune/graph-explorer
8054
```
8155

82-
| Option | Description |
83-
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
84-
| `-p 80:80 -p 443:443` | Maps HTTP and HTTPS ports from the container to the host. |
85-
| `--network graph-net` | Connects the container to the shared Docker network so it can reach BlazeGraph and the reverse proxy by container name. |
86-
| `--restart unless-stopped` | Automatically restarts the container on failure or host reboot, unless explicitly stopped. |
87-
| `--env HOST=localhost` | Sets the hostname used in the self-signed TLS certificate generated by Graph Explorer. |
56+
| Option | Description |
57+
| -------------------------- | ------------------------------------------------------------------------------------------------- |
58+
| `-p 80:80 -p 443:443` | Maps HTTP and HTTPS ports from the container to the host. |
59+
| `--network graph-net` | Connects the container to the shared Docker network so it can reach BlazeGraph by container name. |
60+
| `--restart unless-stopped` | Automatically restarts the container on failure or host reboot, unless explicitly stopped. |
61+
| `--env HOST=localhost` | Sets the hostname used in the self-signed TLS certificate generated by Graph Explorer. |
8862

89-
Then update the **Graph Connection URL** to use the container name: `http://blazegraph-proxy:8080`
63+
When both containers are on the same network, update the **Graph Connection URL** to use the container name: `http://blazegraph:9999/blazegraph/namespace/kb/sparql`
9064

9165
For more details on container networking, see the [Docker networks documentation](https://docs.docker.com/network/).
9266

9367
## Troubleshooting
9468

9569
### Schema sync fails or queries return errors
9670

97-
Graph Explorer's proxy server appends `/sparql` to the Graph Connection URL when making SPARQL requests. BlazeGraph does not serve its SPARQL endpoint at `/sparql` — it uses `/blazegraph/namespace/<ns>/sparql` instead. If you see connection errors or empty results, verify that the reverse proxy is running and correctly rewriting the path.
98-
99-
Test the reverse proxy directly:
71+
Verify that the SPARQL endpoint is reachable by testing it directly:
10072

10173
```
102-
curl -X POST http://localhost:8080/sparql \
74+
curl -X POST http://localhost:9999/blazegraph/namespace/kb/sparql \
10375
-H "Content-Type: application/x-www-form-urlencoded" \
10476
-d "query=SELECT * WHERE { ?s ?p ?o } LIMIT 1"
10577
```
10678

107-
If this returns SPARQL results, the reverse proxy is working. If it returns a 404 or connection error, check the nginx configuration and ensure all containers are on the same Docker network.
79+
If this returns SPARQL results, BlazeGraph is working correctly. If it returns a 404, check that the namespace in the URL matches your BlazeGraph configuration.
10880

10981
### Connection refused between containers
11082

@@ -114,7 +86,7 @@ If Graph Explorer cannot reach BlazeGraph, verify all containers are on the same
11486
docker network inspect graph-net
11587
```
11688

117-
The default `localhost` address does not work between Docker containers. Use container names (e.g., `blazegraph`, `blazegraph-proxy`) as hostnames instead.
89+
The default `localhost` address does not work between Docker containers. Use container names (e.g., `blazegraph`) as hostnames instead.
11890

11991
### BlazeGraph UI not accessible
12092

0 commit comments

Comments
 (0)