Spaces:
Paused
Paused
missing rewrite
Browse files- nginx.conf +5 -7
- run.sh +1 -1
nginx.conf
CHANGED
@@ -15,15 +15,13 @@ server {
|
|
15 |
}
|
16 |
|
17 |
location /cheerpj {
|
18 |
-
# Serve backend from port
|
19 |
-
|
|
|
20 |
proxy_http_version 1.1;
|
21 |
proxy_set_header Upgrade $http_upgrade;
|
22 |
proxy_set_header Connection 'upgrade';
|
23 |
-
proxy_set_header Host
|
24 |
-
|
25 |
-
|
26 |
-
# Disable cache on websockets
|
27 |
-
expires -1;
|
28 |
}
|
29 |
}
|
|
|
15 |
}
|
16 |
|
17 |
location /cheerpj {
|
18 |
+
# Serve backend from port
|
19 |
+
rewrite /cheerpj/(.*) /$1 break;
|
20 |
+
proxy_pass http://localhost:8000;
|
21 |
proxy_http_version 1.1;
|
22 |
proxy_set_header Upgrade $http_upgrade;
|
23 |
proxy_set_header Connection 'upgrade';
|
24 |
+
proxy_set_header Host $host;
|
25 |
+
proxy_cache_bypass $http_upgrade;
|
|
|
|
|
|
|
26 |
}
|
27 |
}
|
run.sh
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
service nginx start
|
4 |
-
python -m http.server
|
5 |
uvicorn "app:app" --port 7860 --host 0.0.0.0
|
6 |
pkill -F http_server.pid
|
7 |
rm http_server.pid
|
|
|
1 |
#!/bin/bash
|
2 |
|
3 |
service nginx start
|
4 |
+
python -m http.server --directory ./static --bind 0.0.0.0 8000 & echo $! > http_server.pid
|
5 |
uvicorn "app:app" --port 7860 --host 0.0.0.0
|
6 |
pkill -F http_server.pid
|
7 |
rm http_server.pid
|