radames commited on
Commit
96ce0e1
1 Parent(s): 85caf0a

missing rewrite

Browse files
Files changed (2) hide show
  1. nginx.conf +5 -7
  2. run.sh +1 -1
nginx.conf CHANGED
@@ -15,15 +15,13 @@ server {
15
  }
16
 
17
  location /cheerpj {
18
- # Serve backend from port 8000
19
- proxy_pass http://localhost:8080;
 
20
  proxy_http_version 1.1;
21
  proxy_set_header Upgrade $http_upgrade;
22
  proxy_set_header Connection 'upgrade';
23
- proxy_set_header Host "localhost:8080";
24
- proxy_pass_request_headers on;
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 8080 --directory ./static/ & 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
 
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