full-stack-fastapi-template icon indicating copy to clipboard operation
full-stack-fastapi-template copied to clipboard

Is Nginx used and working ?

Open Etisti opened this issue 3 years ago • 7 comments

Hi, i would like to know, is Nginx used ?

  • By front end ? => full-stack-fastapi-postgresql/{{cookiecutter.project_slug}}/frontend/nginx-backend-not-found.conf for wich purpose ?

  • Is it used as reverse proxy and/or load balancer too ?

  • If used why using Nginx AND Traefik ???

Thanks a lot for thoses informations

Etisti avatar Jul 19 '21 11:07 Etisti

Only Traefik is used as reverse proxy.

Nginx is used inside frontend docker container. I am sure nginx is not used anywhere else.

karolzlot avatar Aug 03 '21 22:08 karolzlot

why it is used inside frontend docker container and not has reverse proxy ? I don't understand the purpose of having 2 reverse proxy here ^^'

Etisti avatar Aug 04 '21 19:08 Etisti

Nginx is not only reverse proxy, it is also a web server.

In this case it is configured to be used as a webserver to serve react app, you can see it in nginx.conf.

The only reverse proxy used in this project is traefik.

I think traefik is more modern than ngnix, so it was chosen for this project.

karolzlot avatar Aug 04 '21 20:08 karolzlot

I don't understand really well... So how many servers are set up on this project ? Does the front end has his own server so it is like an other app communicating with the fastAPI app ? And traefik load balances the (how many?) gunicorns/uvicorns serveurs ? I'm having a bad time trying to vizualise this I'm sorry 😅

Etisti avatar Aug 05 '21 11:08 Etisti

Each container is a server. You can run reach container separately.

I think you need to read more about docker/ docker compose and practice on simpler projects first

karolzlot avatar Aug 05 '21 17:08 karolzlot

I know about docker and compose. It is just that I don't understand that you separate one serveur to serve for front end and an other one for back end... It is the architecture that I don't understand well

Etisti avatar Aug 05 '21 18:08 Etisti

It actually is quite a standard architecture. It allows scaling the backend independently of the front end. And the load balancing can be for the backend services (which could be more than one)

shoaib30 avatar Aug 09 '21 09:08 shoaib30