HTTPS and gunicorn

I'm working on a Python ssl client/server apps on Flask. I've tested them by starting gunicorn as follows:

gunicorn --bind :8080 --keyfile server.key --certfile server.crt --ca-certs app:app

And I'm able to receive data no problem. Now I want to add a supervisord script file to auto reload gunicorn if it crashes etc..

[program:wsgi]
directory=/home/FirstApp
command=/home/user/FirstApp/venv/bin/gunicorn --workers=3 --keyfile certs/server.key --certfile certs/server.crt wsgi:app
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
stderr_logfile=/var/log/wsgi/wsgi.err.log
stdout_logfile=/var/log/wsgi/wsgi.out.log

Then reload/run supervisor and it shows that is running but when I try to connect just like I did before adding the supervisor I get a connection refuse error:

curl --insecure https://serverip:8080/test

output

curl: (7) Failed to connect to serverip port 8080: Connection refused

I don't understand why this is happening. It works perfectly fine when I'm not running the supervisord script? ….

1 Reply

@nullt0ne --

The only thing I can think of is that supervisord has port 8080 open exclusively. This is easy to verify with any of these:

sudo lsof -i
sudo netstat -lptu
sudo netstat -tulpn

You may not have lsof installed on your system but you will definitely have netstat.

-- sw

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct