mirror of
https://github.com/kossakovsky/n8n-install.git
synced 2026-03-08 06:43:22 +00:00
Add Nginx configuration for RAGFlow service in docker-compose.yml
- 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.
This commit is contained in:
@@ -837,6 +837,7 @@ services:
|
||||
- MINIO_BUCKET=ragflow
|
||||
volumes:
|
||||
- ragflow_data:/ragflow
|
||||
- ./ragflow/nginx.conf:/etc/nginx/sites-available/default:ro
|
||||
depends_on:
|
||||
infinity:
|
||||
condition: service_started
|
||||
|
||||
69
ragflow/nginx.conf
Normal file
69
ragflow/nginx.conf
Normal file
@@ -0,0 +1,69 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user