Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

427
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda