s3rius / FastAPI-template

Feature rich robust FastAPI template.
MIT License
1.9k stars 164 forks source link

Add a reverse proxy ? #101

Closed sorasful closed 2 years ago

sorasful commented 2 years ago

Hi there !

Since this template is very complete and handle a lot of things, I was wondering if it could be a good idea to add an option to set up a reverse proxy (Nginx or Traefik or both).

Since anyway, it's most likely that a lot of people will go through this phase and each time, it's kind of a pain. And now we have solutions to automatically generate SSL certificates with LetsEncrypt, so I was thinking about this.

What do you think ?

s3rius commented 2 years ago

Yeah, that's super nice Idea.

When I was messing around with traefik I was using labels to containers. It's easy to add in template.

But what do you want to see for nginx configuration? Because nginx is configured separately from docker-compose.

sorasful commented 2 years ago

Actually, I've been working mostly with Traefik, but I think we can also put nginx in the docker-compose and add the config files in the project. I've found an example : https://linuxtut.com/en/02ed76b94c60deba8282/
But I'm sure there are plenty.

I don't know, but we can start by adding on Traefik for now. I think it's enough and maybe open an issue if there's a real need for Nginx ?

s3rius commented 2 years ago

Yes, let's focus on traefik. At least for now.

Also, I once tried this project: https://hub.docker.com/r/jwilder/nginx-proxy. It's nice and easy to configure. Almost as traefik, but nginx.

s3rius commented 2 years ago

I added traefik labels. Will release in 3.3.7.

s3rius commented 2 years ago

This issue was closed automatically. I reopen it in case if someone will request to add the nginx configuration.

s3rius commented 2 years ago

Closed due to inactivity.