Draft
Conversation
13f5556 to
75974a8
Compare
Add FastCGI binary protocol support via --protocol fastcgi, enabling gunicorn to receive requests from nginx using fastcgi_pass directive. New module gunicorn/fastcgi/: - constants.py: Protocol constants (record types, roles, flags) - errors.py: FastCGI-specific exceptions - message.py: FastCGIRequest parser with multiplexing support - parser.py: FastCGIParser extending base Parser - response.py: FastCGIResponse with STDOUT/END_REQUEST framing Configuration: - --protocol fastcgi: Enable FastCGI protocol - --fastcgi-allow-from: IP allowlist (default: 127.0.0.1,::1) Integration: - Protocol routing in gunicorn/http/__init__.py - WSGI environ creation in gunicorn/http/wsgi.py - Error handling in gunicorn/workers/base.py Tests: - 60 unit tests in tests/test_fastcgi.py - 24 Docker integration tests in tests/docker/fastcgi/
75974a8 to
b44ba7b
Compare
Owner
Author
|
converting as a draft. support for asgi need to be added |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--protocol fastcgifastcgi_passdirectiveChanges
New module:
gunicorn/fastcgi/constants.py- Protocol constants (record types, roles, flags, status codes)errors.py- FastCGI-specific exceptions (InvalidFastCGIRecord,UnsupportedRole,ForbiddenFastCGIRequest)message.py-FastCGIRequestparser with multiplexing support (FastCGIConnectionState)parser.py-FastCGIParserextending base Parserresponse.py-FastCGIResponsewith STDOUT/END_REQUEST record framingConfiguration
--protocol fastcgi- Enable FastCGI protocol--fastcgi-allow-from- IP allowlist (default:127.0.0.1,::1)Integration
gunicorn/http/__init__.py- Protocol routing for FastCGIgunicorn/http/wsgi.py-create_fastcgi()for WSGI environ from CGI varsgunicorn/workers/base.py- FastCGI error handlingUsage
nginx configuration:
Tests
tests/test_fastcgi.pytests/docker/fastcgi/