56 lines
1.7 KiB
Nginx Configuration File
56 lines
1.7 KiB
Nginx Configuration File
server {
|
|
listen 80;
|
|
server_name api.crawl4ai.com;
|
|
|
|
# Main logging settings
|
|
error_log /var/log/nginx/error.log debug;
|
|
access_log /var/log/nginx/access.log combined buffer=512k flush=1m;
|
|
|
|
# Timeout and buffering settings
|
|
proxy_connect_timeout 300;
|
|
proxy_send_timeout 300;
|
|
proxy_read_timeout 300;
|
|
send_timeout 300;
|
|
proxy_buffer_size 128k;
|
|
proxy_buffers 4 256k;
|
|
proxy_busy_buffers_size 256k;
|
|
|
|
# Health check location
|
|
location /health {
|
|
proxy_pass http://127.0.0.1:8000/health;
|
|
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;
|
|
}
|
|
|
|
# Main proxy for application endpoints
|
|
location / {
|
|
proxy_pass http://127.0.0.1:8000;
|
|
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;
|
|
add_header X-Debug-Info $request_uri;
|
|
proxy_request_buffering off;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
proxy_buffering off;
|
|
}
|
|
|
|
# New endpoint: serve Nginx error log
|
|
location /nginx/error {
|
|
# Using "alias" to serve the error log file
|
|
alias /var/log/nginx/error.log;
|
|
# Optionally, you might restrict access with "allow" and "deny" directives.
|
|
}
|
|
|
|
# New endpoint: serve Nginx access log
|
|
location /nginx/access {
|
|
alias /var/log/nginx/access.log;
|
|
}
|
|
|
|
client_max_body_size 10M;
|
|
client_body_buffer_size 128k;
|
|
}
|