add api for descriptor to root domain, tidying things up

This commit is contained in:
2026-03-19 13:35:14 -07:00
parent cf269b83af
commit 7c29cbdab5
7 changed files with 97 additions and 39 deletions

View File

@ -10,31 +10,40 @@ server {
listen 80;
server_name localhost;
# --------------------------------------------------------------------
# Proxy everything under "/" to the php server backend
# --------------------------------------------------------------------
location / {
proxy_pass http://192.168.37.1:8080;
# ---------------------------------------
# The API only /descriptor
# ---------------------------------------
location = /descriptor {
proxy_pass http://192.168.37.1:5000/descriptor;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
# ----- Custom Nginx Configuration (inside <location> block) -----
location /socket.io/ {
# Forward to the Node WS server
proxy_pass http://192.168.37.1:3000; # or <node_container_ip>
proxy_set_header X-Forwarded-Proto $sceme;
}
# Keep WebSocket upgrade headers
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# ---------------------------------------
# WebSocket endpoint
# ---------------------------------------
location /socket.io/ {
proxy_pass http://192.168.37.1:3000/socket.io/;
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;
}
# Optional: pass on other headers you care about
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;
}
# ---------------------------------------
# All other paths → Apache (PHP)
# ---------------------------------------
location / {
proxy_pass http://192.168.37.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}