backup
This commit is contained in:
67
nginx/nginx.conf
Normal file
67
nginx/nginx.conf
Normal file
@@ -0,0 +1,67 @@
|
||||
user nginx;
|
||||
worker_processes auto;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
multi_accept on;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
sendfile on;
|
||||
tcp_nopush on;
|
||||
tcp_nodelay on;
|
||||
keepalive_timeout 65;
|
||||
types_hash_max_size 4096;
|
||||
|
||||
gzip on;
|
||||
gzip_comp_level 5;
|
||||
gzip_min_length 1024;
|
||||
gzip_proxied any;
|
||||
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml;
|
||||
|
||||
upstream app_backend {
|
||||
server translator-app:12010 max_fails=3 fail_timeout=10s;
|
||||
keepalive 64;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 12010;
|
||||
server_name _;
|
||||
|
||||
# Adjust for document uploads (can be large)
|
||||
client_max_body_size 500m;
|
||||
|
||||
# Proxy API requests to Flask/Gunicorn
|
||||
location /api/ {
|
||||
proxy_pass http://app_backend;
|
||||
proxy_http_version 1.1;
|
||||
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 600s; # Longer timeout for translation processing
|
||||
proxy_send_timeout 600s;
|
||||
proxy_connect_timeout 10s;
|
||||
proxy_buffering off; # Disable buffering for real-time progress
|
||||
}
|
||||
|
||||
# All other routes (frontend SPA and static) via backend
|
||||
location / {
|
||||
proxy_pass http://app_backend;
|
||||
proxy_http_version 1.1;
|
||||
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 120s;
|
||||
proxy_send_timeout 120s;
|
||||
proxy_connect_timeout 5s;
|
||||
proxy_buffering on;
|
||||
proxy_buffers 32 32k;
|
||||
proxy_busy_buffers_size 64k;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user