Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

432
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!