Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

425
Vistas
Including a Python Flask .conf file in nginx.conf with Windows

I'm creating Flask API's on Windows. I'm using waitress as WSGI and it's hosted at a Windows server machine. I want to reverse proxy in order to have multiple ports with the same service (since the service take a bit of time like 6 seconds). I'm already using multi-threading but I really need to reverse proxy that. I created a python.conf file:

upstream flask_api {

    server localhost:8000;
    server localhost:5000;
    server localhost:5001;
}

server {
        listen 80;

        location /service {
            proxy_pass "http://flask_api/service";
        }
}

where I'm simply trying to be able to access multiple ports when localhost/service is requested, the localhosts are already running. I've read some tutorials but still get error 404 when I try localhost/service (same error if I type anything after / that I didn't specify). Because of that I think the python.conf file is not being included at the nginx.conf file. How can I do that on Windows? I wrote :

    include servers/*;
    include C:\Users\Gabriel\loadbalancer\python.conf;

at the end of http{ } in nginx.conf.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

It kind of worked when I erased the entire nginx.config file and rewrote it directly, that's how it looks now:

events { }

http {
        upstream flask_api {

        server localhost:8000;
        server localhost:5000;
        server localhost:5001;
    }

    server {
            listen 80;
            location /service {
                proxy_pass "http://flask_api/service";
            }
    }
}

The ports are just returning "serving on port 'x'" so when I make a browser request it shows me the message. But when I refresh it the request never end, but once I stop this frozen request and make another one it works perfectly.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda