File size: 597 Bytes
8c0bb2f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
worker_processes auto;
events { worker_connections 1024; }
http {
  sendfile on;
  server {
    # HF Spaces proxies public traffic to $PORT. We listen there.
    listen 7860;

    # Streamlit frontend
    location / {
      proxy_pass http://127.0.0.1:9000/;
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    # FastAPI backend on same origin via path prefix
    location /api/ {
      proxy_pass http://127.0.0.1:9001/;
      proxy_set_header Host $host;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
  }
}