I am trying to serve a flask application using nginx and uwsgi, through an ubuntu docker container, while the host is also an ubuntu 18.04 OS.
This is the conf file for the nginx server, for which I have created a symbolic link in /etc/nginx/sites-enabled
:
server {
listen 1611;
real_ip_header X-Forwarded-For;
set_real_ip_from 127.0.0.1;
server_name localhost;
location / {
include uwsgi_params;
uwsgi_pass unix:/var/www/html/step_service/socket.sock;
uwsgi_modifier1 30;
}
}
The `uwsgi.ini' file is as follows:
[uwsgi]
base=/var/www/html/step_service
app=app
module=%(app)
callable = app
home=%(base)/venv
pythonpath=%(base)
socket=%(base)/socket.sock
chmod-socket=777
master=true
processes=5
threads=5
die-on-term=true
autostart=true
autorestart=true
harakiri=30
logto=/var/www/html/step_service/log/%n.log
The logs of uwsgi seem to indicate success:
* Serving Flask app "app" (lazy loading)
* Environment: production
WARNING: Do not use the development server in a production environment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
The logs of nginx server (in particular error.log
) is:
2019/04/18 16:23:30 [error] 6729#6729: *1 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 172.17.0.1, server: localhost, request: "GET /rec/1/1 HTTP/1.1
", upstream: "uwsgi://unix:/var/www/html/step_service/socket.sock", host: "172.17.0.2:1611"
Any ideas would be more than welcome!