51 lines
1.1 KiB
Nginx Configuration File
51 lines
1.1 KiB
Nginx Configuration File
upstream webapi {
|
|
server didiAI-web-api:51100;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name _;
|
|
|
|
# Request body limit
|
|
client_max_body_size 1m;
|
|
|
|
# Timeouts
|
|
proxy_connect_timeout 60s;
|
|
proxy_send_timeout 120s;
|
|
proxy_read_timeout 120s;
|
|
|
|
# Gzip compression
|
|
gzip on;
|
|
gzip_types application/json text/plain;
|
|
gzip_min_length 256;
|
|
gzip_vary on;
|
|
|
|
# Proxy buffering
|
|
proxy_buffering on;
|
|
proxy_buffer_size 4k;
|
|
proxy_buffers 8 8k;
|
|
|
|
# Proxy settings
|
|
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_set_header X-Request-ID $request_id;
|
|
|
|
# Health check endpoint
|
|
location /health {
|
|
proxy_pass http://webapi/health;
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
|
|
location /ready {
|
|
proxy_pass http://webapi/ready;
|
|
add_header Cache-Control "no-cache";
|
|
}
|
|
|
|
# API endpoints
|
|
location / {
|
|
proxy_pass http://webapi;
|
|
}
|
|
}
|