Spaces:
Building
Building
user user; | |
worker_processes auto; | |
pid /tmp/nginx.pid; | |
error_log /tmp/error.log; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
access_log /tmp/access.log; | |
upstream chainlit { | |
server 127.0.0.1:8501; | |
} | |
upstream fastapi { | |
server 127.0.0.1:8000; | |
} | |
server { | |
listen 7860; | |
# Chainlit UI with WebSocket support | |
location / { | |
proxy_pass http://chainlit; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header Host $host; | |
proxy_read_timeout 86400; | |
proxy_cache_bypass $http_upgrade; | |
} | |
# FastAPI endpoints | |
location /api/ { | |
proxy_pass http://fastapi; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_set_header X-Forwarded-Proto $scheme; | |
proxy_read_timeout 86400; | |
proxy_cache_bypass $http_upgrade; | |
} | |
} | |
} |