mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-01 18:21:30 +08:00
Add comprehensive integration tests verifying gunicorn's uWSGI binary protocol works correctly with nginx's uwsgi_pass directive. Test categories: - Basic GET/POST requests with query strings and large bodies - Header preservation (custom headers, Host, Content-Type) - HTTP keep-alive connections - Error responses (400-503 status codes) - WSGI environ variables - Large response streaming (1MB) - Concurrent request handling - Edge cases (binary data, unicode, long headers) Architecture: pytest -> nginx:8080 -> uwsgi_pass -> gunicorn:8000 Also adds GitHub Actions workflow that runs on changes to uwsgi module or docker test files.
47 lines
1.1 KiB
Nginx Configuration File
47 lines
1.1 KiB
Nginx Configuration File
worker_processes 1;
|
|
|
|
events {
|
|
worker_connections 1024;
|
|
}
|
|
|
|
http {
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
|
'$status $body_bytes_sent "$http_referer" '
|
|
'"$http_user_agent"';
|
|
|
|
access_log /var/log/nginx/access.log main;
|
|
error_log /var/log/nginx/error.log debug;
|
|
|
|
sendfile on;
|
|
keepalive_timeout 65;
|
|
|
|
upstream gunicorn {
|
|
server gunicorn:8000;
|
|
}
|
|
|
|
server {
|
|
listen 8080;
|
|
server_name localhost;
|
|
|
|
# Increase buffer sizes for large headers
|
|
uwsgi_buffer_size 32k;
|
|
uwsgi_buffers 8 32k;
|
|
uwsgi_busy_buffers_size 64k;
|
|
|
|
# Read timeout for large responses
|
|
uwsgi_read_timeout 300s;
|
|
|
|
location / {
|
|
uwsgi_pass gunicorn;
|
|
include uwsgi_params;
|
|
|
|
# Pass additional headers
|
|
uwsgi_param HTTP_X_FORWARDED_FOR $proxy_add_x_forwarded_for;
|
|
uwsgi_param HTTP_X_REAL_IP $remote_addr;
|
|
}
|
|
}
|
|
}
|