GeezerVison is showing github.com — GitHub - fnep/example_fastapi_behind_apache_using_cgi: example how to run FastApi behind Apache without reverse proxy using mod_wsgi
Folders and files
| Name | Name | Last commit message | Last commit date |
|---|
| | | |
| | | |
| | | |
| | | |
| | | |
|
Repository files navigation
Run FastApi behind Apache with cgi
This is an example repository, to show how to run FastAPI behind Apache HTTP Server without reverse proxy, but using mod_cgid with a venv and the WSGIMiddleware instead.
⚠️ This is definitely not recommended (for example because it's super slow), but in some cases, it is not an option or not wanted to run a separate server process (like using Uvicorn) or to at least to use wsgi. I just found it challenging to see if it works.
This example is in a Docker container, so you can run it with:
and check the result with:
> curl http://localhost:8080/api/
{"message":"Hello World 👋"}
… but it is more meant to be a documentation and one can install the same everywhere.
About
example how to run FastApi behind Apache without reverse proxy using mod_wsgi
Topics
Resources
Stars
3 stars
Watchers
1 watching
Forks