rag-frontend/nginx.conf
向宁 755517a068 feat: add Dockerfile and upgrade Jenkinsfile to full CI/CD
- Multi-stage build: node:22 (pnpm build) → nginx runtime
- nginx.conf with SPA routing and API proxy
- Jenkinsfile: Docker build → push → deploy
2026-05-17 19:17:07 +08:00

27 lines
691 B
Nginx Configuration File

server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# SPA fallback
location / {
try_files $uri $uri/ /index.html;
}
# Proxy API requests to rag-backend
location /api/ {
proxy_pass http://192.168.1.154:5211/api/;
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;
}
# Static file caching
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
}
}