Skip to content

example how to run FastApi behind Apache without reverse proxy using mod_wsgi

Notifications You must be signed in to change notification settings

fnep/example_fastapi_behind_apache_using_wsgi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run FastApi behind Apache without reverse proxy

This is an example repository, to show how to run FastAPI behind Apache HTTP Server without reverse proxy, but using mod_wsgi with a venv and the WSGIMiddleware instead.

In some cases, it is not an option or not wanted to run a separate server process (like using Uvicorn).

This example is in a Docker container, so you can run it with:

> docker compose up

and check the result with:

> curl http://localhost:8080/
{"message":"Hello World 👋"}

… but it is more meant to be a documentation and one can install the same everywhere.

The image is based un Ubuntu 22.04 and uses Python 3.10. There is an alternative image based on the Red Hat Universal Base Images (UBI) 9 and Python 3.9 in the Dockerfile.redhat file.

About

example how to run FastApi behind Apache without reverse proxy using mod_wsgi

Topics

Resources

Stars

Watchers

Forks