kanishcr7 commited on
Commit
b8925b7
·
1 Parent(s): 272bd90

Final Submission: Added SOC Dashboard and fixed UI explorer

Browse files
Files changed (2) hide show
  1. nginx.conf +7 -9
  2. start.sh +4 -0
nginx.conf CHANGED
@@ -18,16 +18,14 @@ http {
18
  server {
19
  listen ${PORT};
20
 
21
- # Route OpenEnv endpoints to FastAPI
22
- location /reset { proxy_pass http://127.0.0.1:8000/reset; }
23
- location /step { proxy_pass http://127.0.0.1:8000/step; }
24
- location /state { proxy_pass http://127.0.0.1:8000/state; }
25
- location /openapi.json { proxy_pass http://127.0.0.1:8000/openapi.json; }
26
- location /docs { proxy_pass http://127.0.0.1:8000/docs; }
27
- location /web { proxy_pass http://127.0.0.1:8000/web; }
28
- location /assets { proxy_pass http://127.0.0.1:8000/assets; }
29
 
30
- # Route everything else to Streamlit (including WebSockets)
31
  location / {
32
  proxy_pass http://127.0.0.1:8501;
33
  proxy_http_version 1.1;
 
18
  server {
19
  listen ${PORT};
20
 
21
+ # Explicitly route OpenEnv API endpoints to FastAPI (port 8000)
22
+ location ~ ^/(reset|step|state|openapi.json|docs|web|assets|health) {
23
+ proxy_pass http://127.0.0.1:8000;
24
+ proxy_set_header Host $host;
25
+ proxy_set_header X-Real-IP $remote_addr;
26
+ }
 
 
27
 
28
+ # Catch-all: Route everything else to Streamlit (port 8501)
29
  location / {
30
  proxy_pass http://127.0.0.1:8501;
31
  proxy_http_version 1.1;
start.sh CHANGED
@@ -17,6 +17,10 @@ streamlit run patchhawk/app/dashboard.py \
17
  --server.headless true \
18
  --browser.gatherUsageStats false 2>&1 | sed 's/^/[STREAMLIT] /' &
19
 
 
 
 
 
20
  # Start Nginx in foreground on PORT
21
  echo "[SYSTEM] Starting Nginx reverse proxy on ${PORT}..."
22
  envsubst '${PORT}' < /etc/nginx/nginx.conf > /tmp/nginx.conf
 
17
  --server.headless true \
18
  --browser.gatherUsageStats false 2>&1 | sed 's/^/[STREAMLIT] /' &
19
 
20
+ # Give services a moment to bind
21
+ echo "[SYSTEM] Waiting for services to initialize..."
22
+ sleep 5
23
+
24
  # Start Nginx in foreground on PORT
25
  echo "[SYSTEM] Starting Nginx reverse proxy on ${PORT}..."
26
  envsubst '${PORT}' < /etc/nginx/nginx.conf > /tmp/nginx.conf