mirror of
https://github.com/kossakovsky/n8n-install.git
synced 2026-03-07 14:23:08 +00:00
- Introduced a new Nginx configuration file to handle static file serving and API request routing. - Updated docker-compose.yml to mount the Nginx configuration for the RAGFlow service, ensuring proper reverse proxy setup and static asset management.
70 lines
2.1 KiB
Nginx Configuration File
70 lines
2.1 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
# Increase max body size for file uploads
|
|
client_max_body_size 100M;
|
|
|
|
# Serve static files from the web frontend
|
|
location / {
|
|
root /ragflow/web/dist;
|
|
try_files $uri $uri/ /index.html;
|
|
index index.html;
|
|
}
|
|
|
|
# Proxy API requests to Flask backend
|
|
location /v1/ {
|
|
proxy_pass http://127.0.0.1:9380;
|
|
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_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_read_timeout 300s;
|
|
proxy_connect_timeout 75s;
|
|
}
|
|
|
|
# Proxy admin API requests to admin Flask backend
|
|
location /v1/admin/ {
|
|
proxy_pass http://127.0.0.1:9381;
|
|
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_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_read_timeout 300s;
|
|
proxy_connect_timeout 75s;
|
|
}
|
|
|
|
# Additional API endpoints
|
|
location ~ ^/(api|auth|files)/ {
|
|
proxy_pass http://127.0.0.1:9380;
|
|
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_http_version 1.1;
|
|
proxy_read_timeout 300s;
|
|
proxy_connect_timeout 75s;
|
|
}
|
|
|
|
# Static assets with caching
|
|
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
|
root /ragflow/web/dist;
|
|
expires 1y;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# Health check endpoint
|
|
location /health {
|
|
access_log off;
|
|
return 200 "healthy\n";
|
|
add_header Content-Type text/plain;
|
|
}
|
|
}
|
|
|