I'm trying to run a Flask application via HTTPS on Gunicorn.
Up to now I have been running it successfully via HTTP using a command like the following:
gunicorn --workers=4 "program.__main__:WSGI()" --bind=0.0.0.0:8080
Now I am trying to run it via HTTPS using a command like the following:
gunicorn --workers=4 "program.__main__:WSGI()" --bind=0.0.0.0:443 --certfile=fullchain.pem --keyfile=privkey.pem
When I run this as a normal user, I get output like the following:
[2018-08-13 21:26:28 +0000] [15170] [INFO] Starting gunicorn 19.9.0
[2018-08-13 21:26:28 +0000] [15170] [ERROR] Retrying in 1 second.
[2018-08-13 21:26:29 +0000] [15170] [ERROR] Retrying in 1 second.
[2018-08-13 21:26:30 +0000] [15170] [ERROR] Retrying in 1 second.
[2018-08-13 21:26:31 +0000] [15170] [ERROR] Retrying in 1 second.
[2018-08-13 21:26:32 +0000] [15170] [ERROR] Retrying in 1 second.
[2018-08-13 21:26:33 +0000] [15170] [ERROR] Can't connect to ('0.0.0.0', 443)
As root, it works, but I'm disinclined to run a web server as root. How should I run this securely?
0 Answers