Spaces:
Sleeping
Sleeping
Final Submission: Added SOC Dashboard and fixed UI explorer
Browse files- nginx.conf +7 -9
- start.sh +4 -0
nginx.conf
CHANGED
|
@@ -18,16 +18,14 @@ http {
|
|
| 18 |
server {
|
| 19 |
listen ${PORT};
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
location
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 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 (
|
| 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
|