Questions tagged [gunicorn]

A Python WSGI HTTP Server for UNIX, light and speedy. It's a pre-fork worker model ported from Ruby's Unicorn project. http://gunicorn.org

Filter by
Sorted by
Tagged with
0 votes
1 answer
1k views

pymongo + flask + gunicorn: "Authentication failed" before first operation when "connect=False"

I'm using MongoDB Atlas. I'm have this URL for connecting: mongodb+srv://<LOGIN>:<PASSWORD>@<URL>/<DB>?retryWrites=true&w=majority&authSource=admin. I'm using this ...
Amaimersion's user avatar
2 votes
2 answers
1k views

Django + Gunicorn + Kubernetes: Website down few minutes on new deployment

I am having this issue with Django + Gunicorn + Kubernetes. When I deploy a new release to Kubernetes, 2 containers start up with my current image. Once Kubernetes registers them as ready, which they ...
Özer's user avatar
  • 21
9 votes
3 answers
22k views

Invalid HTTP_HOST header. The domain name provided is not valid according to RFC 1034/1035

I am getting Invalid HTTP_HOST header error on my server. I don't understand why it's happening and how to fix it. Everytime it happens backend stops working and I have to restart the server. Any help ...
Chetan Ganji's user avatar
1 vote
0 answers
2k views

Nginx stopped and failed to restart - open() “/run/nginx.pid” failed

I am running my django apis, deployed on Ubuntu 18, on Nginx and running via Supervisor. I am using Certbot for SSL certs and this is the only web service running on this webserver. No other websites ...
Deepak's user avatar
  • 111
0 votes
0 answers
533 views

EC2+nginx+django+gunicorn+letsencrypt ssl -> TIMED OUT

I've been struggling for a few hours now and went through lots of similar questions on SE. However, I couldn't manage to fix my probelm . To answer the obvious questions: there's no firewall on my ...
OD IUM's user avatar
  • 101
2 votes
0 answers
284 views

How to load balance in nginx based on user category

There will be a web application served by gunicorn with pod instantiated in every node in Kubernetes cluster. External load balancer (limited to the round-robin or least connections methods) drives ...
ipaleka's user avatar
  • 121
0 votes
1 answer
1k views

Gunicorn (with Flask) parameters for Google Cloud Run - production setup?

This question was taken down on SO with a suggestion to ask here, so here goes: Looking for some guidance from people with experience in this area. I run a Docker container (approx. 670mb in size) in ...
Amy Wong's user avatar
  • 101
0 votes
1 answer
151 views

nginx not displaying correct page when navigating to www.domain.com ok when just domain.com

I'm trying to deploy nginx / gunicorn / flask on ubuntu and all seems to be working when I navigate to "domain.com" but when i go to "www.domain.com" i get the defualt splash ...
Lewis Morris's user avatar
1 vote
1 answer
807 views

gunicorn stopped finding wsgi directory

I configured a django app with nginx gunicorn and supervisor. Everything has been working fine for months until today. I have not touched any of the config files but somehow I now get a 502 bad ...
Murcielago's user avatar
0 votes
1 answer
2k views

Running django and gunicorn on raspberry pi

So I am trying to follow this here: https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04 except on the latest raspberry pi. I think ...
Codejoy's user avatar
  • 149
0 votes
1 answer
2k views

Enabling systemctl service does not load at boot

I have set up gunicorn to server two Django sites, as per this setup. This works well. If I run: # systemctl start gunicorn@my_website.service Then all is well and my website is being served as ...
user avatar
0 votes
0 answers
930 views

Nginx: how to increase backlog (net.core.somaxconn), without changing sysctl.conf? Want to allow many pending connections

I am not running a webapp, but rather a Machine Learning model which needs to provide real-time predictions. Am using Nginx with Gunicorn, both of which are running in a docker container. The setup ...
Abhishek Divekar's user avatar
0 votes
1 answer
167 views

systemctl start nginx doesn't do anything

if I do systemctl start nginx, it just goes to the next empty line, without letting server to work, like so: [[/home/sc/pro]]# systemctl start nginx [[/home/sc/pro]]# if I do nginx -t: nginx: the ...
user590950's user avatar
0 votes
0 answers
935 views

504 gateway timeout - ELB, Nginx, Gunicorn

Helllo guys. I am unable to download long-running reports. The site is under ELB, nginx and gunicorn as a backend server. In nginx I configured following settings: proxy_connect_timeout 600s; ...
Sergey Glazyrin's user avatar
0 votes
1 answer
984 views

Conda, Django, Gunicorn and Supervisor bad interpreter: No such file or directory

I'm following this tutorial to deploy my Django app, but modified my executable /var/www/my_django_project/bin/gunicorn_start to use my conda env instead of virtualenv. CONDA_SRC=/home/justin/...
Soubriquet's user avatar
0 votes
1 answer
53 views

Python webserver for mobile app [closed]

I would like to setup a python webserver for my mobile app It will not serve any media, css, html, etc.. Therefore I thought about gunicorn + python app without nginx, at least for the beginning The ...
user2102697's user avatar
1 vote
0 answers
3k views

Why is gunicorn not creating a .sock or .pid file?

First things first, I would like to clarify that I am completely knew to debugging servers and deploying in general. I'm a student developer for my university and so far all of my work has been ...
JohnnyLeek's user avatar
3 votes
1 answer
5k views

Do I have to restart my server after changing settings.py?

I have a django app hosted on digitalocean with gunicorn and nginx. I have just changed something in settings.py. I have taken my SECRET_KEY and now I stored it in etc/secret_key.txt settings.py with ...
Sven's user avatar
  • 135
0 votes
1 answer
269 views

How can I use the django shell while the server is running?

I have a django server deployed on digitalocean with gunicorn and nginx. I followed a tutorial, I think it was this one. Because of the tutorial I have django only installed in a virtualenv. When I ...
Sven's user avatar
  • 135
1 vote
1 answer
1k views

Configuring SSL on nginx with proxy_pass

I am having problems making SSL work for a python/gunicorn based site that works perfectly fine on port 80. I am using proxy_pass to send traffic to upstream. Steps Completed so far Wildcard ...
wellwellwell's user avatar
0 votes
1 answer
201 views

Why is NGINX timing out?

I have an application with about 200k users and am running a NGINX + Gunicorn(Python) server behind an AWS EC2 loadbalancer. I don't understand how my requests is always 4k/minute but only sometimes ...
Devon Bernard's user avatar
0 votes
0 answers
3k views

Django Gunicorn-Nginx 504 gateway timeout

I have read a lot of articles about gunicorn & nginx timeout configs . I have some requests on my website which take longer than 30 seconds . I changed all gunicorn timeouts to 3 seconds but ...
Mehdi bahmanpour's user avatar
1 vote
0 answers
871 views

Server crash (Error 500) repeatedly (running nginx + gunicorn on EC2 instance)

Okay, so I'm really confused about what's happening here. I've had my server up and running for about a month and everything was fine. The server was getting very little traffic (about 50-100 requests ...
user1101329's user avatar
0 votes
1 answer
128 views

unable to access executable in PATH from remote server

I have an web application hosted with Django-gUnicorn-Nginx. The web app is working mostly fine and is accessible except for one functionality. Recently, I added pybedtools, a python wrapper package ...
deman23's user avatar
  • 11
1 vote
1 answer
3k views

flask, gunicorn (gevent), sqlalchemy (postgresql): too many connections

I created Flask WSGI-application which uses gunicorn as WSGI-server, for DB it uses PostgreSQL through Flask SQLAlchemy extension. That's all hosted on Heroku. gunicorn configuration number of ...
Amaimersion's user avatar
0 votes
1 answer
3k views

502 Bad Gateway nginx/1.14.0 (Ubuntu)

Im trying to deploy django app using nginx & gunicorn but its showing error sudo nginx -t nginx: the configuration file /etc/nginx/nginx.conf syntax is ok nginx: configuration file /etc/nginx/...
jagtar's user avatar
  • 1
1 vote
1 answer
5k views

Failed to start gunicorn.service: Unit gunicorn.service not found. Ubunto 18.04

I am following this How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 18.04 guide. I have created the following file .socket sudo nano /etc/systemd/system/gunicorn.socket [Unit] ...
sogu's user avatar
  • 223
0 votes
1 answer
1k views

Nginx not responding from outside the remote box

My website (Django/nginx/gunicorn/mysql) which is hosted on a remote box was working fine, until I decided to restart remote box for some reason. So after the restart, in the remote box when I say ...
deman23's user avatar
  • 11
0 votes
0 answers
844 views

Gubicorn/Nginx does not download files completely: [CRITICAL] WORKER TIMEOUT (pid:18)

I am running a django app with nginx in docker. I can download files via an API using the library requests. When I want to download a file with 55 MB somehow the connection breaks down and the ...
Micromegas's user avatar
0 votes
1 answer
2k views

Receive 404 Not Found for a Flask app when I use Nginx as reverse proxy with Gunicorn socket

I have been following the tutorial here to deploy my own flask app to my Ubuntu 16 server. I used Nginx as a reverse proxy to pass requests to a gunicorn socket. Just in case anyone wants to know ufw ...
wellwellwell's user avatar
3 votes
0 answers
4k views

Load testing throws Server 502 error: Bad Gateway after 700 users. Gunicorn, Gevent, Nginx, Django

I'm trying to reach 2000 concurrent users with my benchmarking tool. I'm using locust to simulate them. My server has 24vCPUs, 128GB RAM, 25SSD. I want to be able to serve 2000 concurrent users ...
Tony Kyriakidis's user avatar
2 votes
1 answer
957 views

Scaling and Load testing Django Nginx and Gunicorn: 502 Server Error + Resource temporarily unavailable gunicorn.sock

I'm doing load testing with locust to see if my server can handle 1500 users. What I'm using: Django, Nginx, Gunicorn, Postgresql My droplet: 24vCPUs, 128GB RAM, 25GB SSD at about 1100 users I start ...
Tony Kyriakidis's user avatar
8 votes
0 answers
1k views

How many celery and gunicorn workers on the same server?

I have one server that runs a Django application served by gunicorn and a Celery task queue. Gunicorn docs suggest (2 x $num_cores) + 1 as the default number of workers. Celery docs show that the ...
YPCrumble's user avatar
  • 175
0 votes
2 answers
3k views

Nginx & Django & Gunicorn - Redirecting subdomain to app

I did an extensive search on the topic but nothing could help me. I am currently building a Django site, and using Nginx to reverse proxy to Gunicorn. I am trying to separate my apps into subdomains....
ACN's user avatar
  • 1
2 votes
1 answer
3k views

Gunicorn does not generate a sock file

First, I'm new to this subject. So I'm trying to serve a hello world flask app with nginx and gunicorn on a Centos7 server. But I'm getting 502 error on website. When I checked nginx's error.log file ...
Saba's user avatar
  • 21
1 vote
1 answer
4k views

Linux journalctl not synced with systemctl status / Journalctl not updating

I am running my custom service, let's call it "foo.service". It's a gunicorn python process which logs a few things. I used to be able to get a real-time log overview using journalctl -u <service&...
Dubb's user avatar
  • 113
0 votes
1 answer
12k views

Failed to start gunicorn.service: Unit is not loaded properly: Bad message

I'm having difficulty configuring gunicorn. So far, I have pulled my django code onto the server, created a virtualenv for python3.6, installed django gunicorn psycop2, using pip3, and that's all fine....
iFunction's user avatar
  • 111
0 votes
0 answers
2k views

nginx+gunicorn+django SSL not working, on Chrome it gives ERR_SSL_PROTOCOL_ERROR, which is "This site can't provide a secure connection."

I've just finished setting up an nginx+gunicorn+django web server (after having virtually the same problem with apache2+wsgi+django), and confirmed it works perfectly over http. After running ...
Keegan Conlee's user avatar
2 votes
1 answer
5k views

How to resolve nginx internal server error

I'm configuring Nginx as a public-facing proxy server to my internal Gunicorn server to host a "Reddit clone" Flask project I'm developing. At one point, Nginx was working properly (when I'd used ...
Neil Patel's user avatar
1 vote
1 answer
4k views

Nginx reverse proxy to https not working

I am trying to run more than one python/gunicorn api over https using nginx as a reverse proxy for my subdomain subdomain.domain.com. Below is my server block file subdomain.domain.com in sites-...
Daniel 's user avatar
3 votes
1 answer
3k views

Opening firewall of ubuntu server to access gunicorn/Flask app running on port 80

I am trying to serve an intranet application from a server running Ubuntu 18.04 on our local network The application is written in Flask and I have deployed it using gunicorn with the command me@...
Tom Close's user avatar
  • 133
0 votes
1 answer
1k views

Localhost reverse proxy fails nginx AWS Ubuntu

I am attempting to to host a Flask app with Gunicoron on a server that hosts multiple web services on Nginx. I am using AWS ubuntu as a test bed for evetually hosting it on said Nginx mutilple web ...
user1449249's user avatar
2 votes
1 answer
5k views

nginx, gunicorn, Django 499 error 60s

I get a 499 error after 60s whatever the config I try. I use Docker on a 8 core/32GB server and there is another nginx/lets-encrypt reverse proxy in front for the others containers. I am more on the ...
Patrick Aymar's user avatar
0 votes
1 answer
615 views

Can upgrading the timeout for my proxy pass in Nginx and Gunicorn cause any problems?

I'm going to add these configuration: proxy_connect_timeout 300s; proxy_read_timeout 300s; and for Gunicorn: gunicorn_django -D -b 127.0.0.1:8901 --workers=5 --pid=/var/webapp/campus.pid --settings=...
dev fan's user avatar
1 vote
1 answer
788 views

Apache mod_expires not setting correct expires datetime

I'm having a problem with mod_expires. I simply set have a default expires of 1 days and then I set the expires by type (for images and audio). So for example i set ExpiresByType image/jpeg "access ...
Isky's user avatar
  • 121
0 votes
0 answers
3k views

Error on configuring gunicorn

I have been following this tutorial to deploy my django project on Digital Ocean. I am trying to configure gunicorn. My project structure looks similar to this: On my settings.py I use DEBUG=False ...
IordanouGiannis's user avatar
0 votes
1 answer
4k views

nginx gunicorn django 502 worker timeout just on some pages

I configured a django app with gunicorn and nginx all was working perfectly until the installation of SSL certifiate on the server. firstly all pages were served perfectly but after some time some ...
chipop's user avatar
  • 1
1 vote
0 answers
697 views

docker-compose, nginx, gunicorn and SSL

I'm trying to set up a django project using SSL. I got it working without SSL but I'm clearly doing something wrong since https:// doesn't work and http:// just redirects to the main nginx site. Here'...
pnus's user avatar
  • 33
2 votes
1 answer
3k views

nginx, docker, and gunicorn url without the port number in the url

I have a django app that's also using gunicorn and nginx. I'm able to access my site using http://url:8000, but I don't know how to correctly configure it so I don't have to use the port number in the ...
pnus's user avatar
  • 33
0 votes
0 answers
794 views

Supervisor requires reload for flask application to work properly

When my server (centOS 7 hosted on a vagrant VM) reboots, my Python Flask application (served up by Gunicorn using nginx as a reverse proxy) throws internal server errors (according to the stack ...
codeAndStuff's user avatar