chatbot_final / nginx.conf
Krish-05's picture
added voice
9f7a5a6 unverified
raw
history blame contribute delete
960 Bytes
worker_processes auto;
pid /var/lib/nginx/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
# Define the FastAPI upstream server
upstream fastapi_backend {
server 127.0.0.1:7860;
}
server {
listen 8501;
root /home/user/app/frontend/dist;
index index.html index.htm;
# Serve static files for the React app
location / {
try_files $uri $uri/ /index.html;
}
# Proxy API requests to the FastAPI backend
location /api/ {
proxy_pass http://fastapi_backend/;
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;
}
}
}