Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions apps/grasp/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,28 @@ server {
# Use relative redirects so they work behind a reverse proxy with a path prefix.
absolute_redirect off;

# WebSocket upgrade for the GRASP /live endpoint.
location /api/live {
proxy_pass http://grasp:6789/live;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

# Proxy all other /api/* requests to the GRASP backend (strips /api prefix).
# e.g. GET /api/knowledge_graphs → http://grasp:6789/knowledge_graphs
location /api/ {
proxy_pass http://grasp:6789/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

# Static assets (checked first due to regex priority).
location ~* \.(?:ico|gif|jpe?g|png|svg|webp|woff2?|ttf|eot|otf|js|css|map|json)$ {
try_files $uri =404;
Expand Down