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
265
questions
0
votes
1
answer
38
views
Dealing with Flask routing paths when deployed behind URL prefix
I have single page application build using the python Flask framework. I'm using gunicorn as the web server and I have containerised it using docker. It is deployed on Azure Kubernetes Services (aks) ...
0
votes
0
answers
50
views
SELinux on RHEL8 with Gunicorn and nginx has problems with saving file into diretory
I have Django application running on RHEL8 via Gunicorn and nginx. All works fine in case of testing with SELinux disabled. When I enable SELinux, there is a problem with saving the picture from ...
0
votes
0
answers
41
views
Which certificate files need to be passed to gunicorn for https?
I have the following files:
private.key, example.com.pem, example.com.crt, example.com.pem-full-chain,
example.com.p7b and server.csr
I am starting gunicorn using :
gunicorn -b example.com:5000 'app:...
0
votes
1
answer
156
views
Gunicorn can't bind port 80
I (want to) have a Google Cloud server running a Gunicorn server, however it refuses to bind to port 80, despite it being free.
Here's the command I'm using to start it:
gunicorn -w 4 -b 0.0.0.0:80 ...
0
votes
0
answers
107
views
flask session work in a development server, but not in a production server(nginx)
I have created a webapp with an authentication system. I use the session module to check if a user is logged in. During the login phase, I set session['logged_id'] = True, and when a client tries to ...
0
votes
0
answers
96
views
Do I need to use an Nginx reverse proxy between AWS Application Load Balancer and Gunicorn running in Fargate?
I have a Django backend application running with Gunicorn inside a Docker container in Fargate.
Since I'm not serving any static files from the Django server (they are being served via Cloudfront) do ...
0
votes
0
answers
392
views
100 concurrent requests to a Django-App with Gunicorn lead to "54: Connection reset by peer" and 502's
I'm hosting a Django-App which serves as an API-Endpoint. Unfortunately the App which uses the API does a lot of concurrent requests on page-load (in the realm of 80-90 requests).
Nginx is running as ...
0
votes
0
answers
148
views
EC2 with a Caddy + Gunicorn setup sporadically unreachable
I have an EC2 instance that runs a Django via gunicorn, in which Caddy sits on top of. The domain is hosted in Route53 with an A record pointing to the IP address of the instance.
Here's what I ...
0
votes
1
answer
151
views
Connect Redis Unix Domain Socket to Django
I have a Django website running via nginx under user www-data and gunicorn under user myuser bound at /run/gunicorn.sock.
nginx works just fine; it acts as a proxy to the gunicorn Unix domain socket. ...
0
votes
0
answers
276
views
Django deploy with Gunicorn, Nginx and Docker-Compose returns Server Error 500
I'm deploying a Django application on ubuntu server, where I have installed Nginx.
The app is deployed using docker-compose and gunicorn.
Here's my nginx configuration:
upstream backend {
server 0....
0
votes
1
answer
716
views
Gunicorn quits without notice
I'm deploying a django/nginx/gunicorn site and am following this guide while doing so. Following the subheading "Final Steps for Production Deployments", I've created a production gunicorn ...
2
votes
1
answer
113
views
get request problems while running nginx + gunicorn + django-plotly-dash
The web site is running, Gigicorn has multipule workers.
For some reason the url_calling : http://web?id=value
the id=value do not propagate coherently, (sometimes it works, but most of the time it ...
0
votes
1
answer
278
views
www subdomain works but others don't
I encountered a problem with nginx I do not understand.
I am able to correctly setup and call www.example.tech and example.tech.
However when adding another subdomain like survey.example.tld to the ...
0
votes
1
answer
691
views
Best way to config gunicorn and nginx with django?
I am trying to deploy django with gunicorn and nginx on heroku, and i'm kinda confused with the way to config gunicorn and nginx, when i searched through internet, they usually create gunicorn.socket
[...
0
votes
1
answer
2k
views
connection refused django gunicorn nginx
I am getting following error when running search feature on my site (search feature makes api request to my api server):
2022/08/31 21:01:56 [error] 726#726: *23 connect() failed (111: Connection ...
0
votes
1
answer
694
views
after applying ssl certificate, static files aren't served anymore
My config file is located in /etc/nginx/sites-enabled is called songreccs.conf and looks like this:
server {
server_name www.songreccs.com songreccs.com;
location /static {
...
1
vote
1
answer
76
views
Nginx behind Apache
I have an apache who is hosting websites
one is 000-default.conf for www.domain1.com
another one is domain2.conf for www.domain2.com
and has a config like this
<VirtualHost *:80>
...
0
votes
0
answers
2k
views
Error 502: Deploy Django application with Gunicorn and Nginx
I have developed a web application with Django and I am trying to publish it in a virtual machine created with Azure. To do that I'm using the following software stack:
Ubuntu (20.04)
Django (3.0.7)
...
0
votes
0
answers
976
views
how do I configure nginx to send user ip in response headers
I have an nginx server I installed on ubuntu 20.04 server.
I'm trying to get the user IP address but nginx doesn't seem to be configured to pass it.
when looking at access logs /var/log/nginx/access....
0
votes
2
answers
490
views
Hosting two different django project in the same droplet with different subdomains (NGINX, Gunicorn, ubuntu)
As the title says I want to host two different django project in the same droplet (NGINX, Gunicorn, ubuntu) with different subdomains. One will be our main site example.com. which is up and running ...
0
votes
1
answer
779
views
Not getting nginx and gunicorn running in Docker container
I am new to Docker and trying my best to figure out every bit, but seriously struggle on starting gunicorn and nginx with my Dockerfile.
Whenever I add the last four lines, the container won't boot ...
0
votes
1
answer
2k
views
Nginx redirects to http://localhost
Brief image of the situation
I can't use domain address for server_name because I can't control DNS server. I must use public IP to connect to my web server.
So I set server_name to _;, but when I ...
1
vote
1
answer
2k
views
Getting timeout errors with nginx+gunicorn application on Azure app services
Guys I need some help with my NGINX config. Right now the Django application is hosted at Azure App services, and going straight to Gunicorn works fine, but when I go trough NGINX I start getting ...
1
vote
1
answer
787
views
Supervisor not reloading Gunicorn properly with Django project
I am using Supervisor to reload Gunicorn when pushing Django project to production :
Workflow :
" && python manage.py migrate"\
" && python manage.py ...
0
votes
0
answers
101
views
Switching from SQLite to Mysql in production causes error
I am using a digital ocean server. After switching to mysql database from sqlite, I got 502 Bad Gateway nginx/1.18.0 (Ubuntu)
This is running fine when I run the project from the terminal using ...
1
vote
0
answers
380
views
How to disable upstream buffering Nginx + Docker + Gunicorn?
I'm trying to use Nginx as proxy server between client and Gunicorn. Nginx, Gunicorn (Django) are Docker's containers. Problem is I can't disable buffering of upstream when I send large file from ...
0
votes
1
answer
788
views
connect() failed (111: Connection refused) when trying to reach 1 of 3 apps
I have two Django apps running on my Debian server with Gunicorn.
One running on port 80(app1), the other on 84(app2). app1 is working fine. But when trying to open app2, I get a 502 Bad Gateway from ...
2
votes
1
answer
825
views
Why is Nginx truncating the JSON streaming response?
Our stack is Client(Browser) <-> Nginx Reverse Proxy <-> Webserver(Flask+Gunicorn) <-> Golang gRPC server
The problem is when the client makes a call to the /realtimedata endpoint, ...
0
votes
0
answers
1k
views
Getting a "403 access denied" after following tutorial
I followed the tutorial located here, Everything seemed to go as the tutorial said it would - except now I'm getting a 403 Forbidden error. I have nginx, gunicorn and django all installed. The nginx ...
1
vote
0
answers
142
views
Response with and in memory file with Django and nginx
I have a piece of code that works fine on my local setup (Django embeded dev server running on Windows) but not on server (ubuntu + gunicorn + nginx)
I build an Excel file et send it from memory like ...
0
votes
1
answer
2k
views
Intermittent 500 Error caused by psycopg2.OperationalError: could not translate host name
20% of requests to our backend Django application (deployed on AWS using ECS and Postgres RDS) are throwing 500 errors. Looking at the ECS logs, various related errors are shown:
psycopg2....
2
votes
1
answer
746
views
Urls.py not updating on Django production server , which uses nginx and gunicorn
I am currently hosting a Django Webapp on an AWS EC2 instance, To run it in production mode I use NGINX and gunicorn.
The Error that I am facing is:
The production server doesnt seem to update urls.py,...
0
votes
0
answers
2k
views
Django / Gunicorn with Nginx reverse proxy - Wrong redirect to base path
I have a Django app successfully running with Gunicorn/Uvicorn, under a subpath of my domain (example.com/myapp).
The Nginx vhost looks like this:
server {
server_name example.com;
location /...
0
votes
0
answers
1k
views
PATCH request returns 404, POST and GET work
I'm working on a web application that interacts with a custom REST API. It's basically a table of data that's updated through the application. I'm trying to use the PATCH method for the updates, but ...
1
vote
1
answer
480
views
How can I setup multiple Django Apps using Supervisor (including Gunicorn and Nginx)? bind() to [::]:8090 failed (98: Address already in use)
I already deployed a Django/Wagtail App using Supervisor, Gunicorn and Nginx (on Debian Buster), so I can reach it with http://xx.xxx.xxx.xxx:8090.
/etc/nginx/sites-available/cms
server {
...
0
votes
1
answer
1k
views
Debug a Nginx vhost as a reverse proxy for a Uvicorn Python API
I have a (Python, DRF-based) API, running as a Uvicorn service on port 8002 on a Debian server.
It runs with no apparent issue, since when I do curl http://127.0.0.1:8002/videos/, I get the expected ...
1
vote
2
answers
2k
views
Gunicorn/Flask reject identical SSL certificate that works fine with Apache
What would cause a Gunicorn server running a Flask app to report a "sslv3 alert certificate unknown" error in the browser, when an Apache server running a WSGI app, using the exact same ...
0
votes
0
answers
2k
views
Curl : Recv failure : Connection Reset By Peer and Unix Socket Crash
I'm trying to set up a unix socket for gunicorn and to ping it from curl (running curl --unix-socket /run/gunicorn.sock http://www.example.com --trace-ascii dump.txt). Unfortunately, the response from ...
0
votes
1
answer
410
views
Flask on cheroot/gunicorn scalability
I have developed a HTTP API endpoint using flask which accepts json data on POST requests and sends back json response.
I have tried using multiple WSGI servers: gunicorn, cheroot, Bjoern behind Nginx ...
-1
votes
1
answer
2k
views
Nginx + Gunicorn + Flask not serving static files
I am new to Nginx and Gunicorn....
I am trying to serve flask app on certain prefix....
ex: https://myweb.com/flask/prefix/
everything works fine except it is not loading static files......
my nginx ...
0
votes
1
answer
616
views
Serving multiple socket using gunicorn and Nginx cause a NotFound error
I am trying to serve two Flask apps using Nginx as a reverse proxy. In my default.conf which I have reloaded using sudo service nginx restart I have got:
location /app2loc/ {
include ...
0
votes
1
answer
1k
views
Static files with Python, Apache (Proxy) and SSL [duplicate]
It's my first question in the community, i apologize in advance if I write something wrong
I developed an application in Python (Django) and in the quality environment I am using gunicorn to provide ...
0
votes
1
answer
251
views
502 error from nginx. It doesn't seem to be listening to any port, but will connect to default
Facts: Nginx default can be accessed. Gunicorn is running, the website can be accessed via LAN. Nginx runs, does not give me any errors. When I check sudo lsof -i -P -n | grep LISTEN , it tells me ...
0
votes
0
answers
959
views
Nginx Gunicorn not serving requests to external ip
I have develop a python flask project which is run on linux server. I'm trying to develop it on my linux server. After much effort on this. I have configured nginx, gunicorn and my application. My ...
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 ...
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 ...
9
votes
3
answers
19k
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 ...
1
vote
0
answers
1k
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 ...
0
votes
0
answers
486
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 ...
2
votes
0
answers
260
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 ...