fmegahed commited on
Commit
8c0bb2f
·
verified ·
1 Parent(s): d7c5224

Create nginx.conf

Browse files
Files changed (1) hide show
  1. nginx.conf +23 -0
nginx.conf ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ worker_processes auto;
2
+ events { worker_connections 1024; }
3
+ http {
4
+ sendfile on;
5
+ server {
6
+ # HF Spaces proxies public traffic to $PORT. We listen there.
7
+ listen 7860;
8
+
9
+ # Streamlit frontend
10
+ location / {
11
+ proxy_pass http://127.0.0.1:9000/;
12
+ proxy_set_header Host $host;
13
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
14
+ }
15
+
16
+ # FastAPI backend on same origin via path prefix
17
+ location /api/ {
18
+ proxy_pass http://127.0.0.1:9001/;
19
+ proxy_set_header Host $host;
20
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
21
+ }
22
+ }
23
+ }