GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

BranchesTags
Open more actions menu

Latest commit

 

History

1 Commit
1 Commit

Folders and files

NameName
Last commit message
Last commit date
Dockerfile
Dockerfile
 
 
apache-vhost.conf
apache-vhost.conf
 
 
docker-compose.yml
docker-compose.yml
 
 
main.py
main.py
 
 
readme.md
readme.md
 
 

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:

> docker compose up

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

apachecgifastapimod-cgistarlette

Resources

Readme
Activity

Stars

3 stars

Watchers

1 watching

Forks

1 fork
Report repository

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.