I need to have uWSGI to only allow connection through https. I can only use uWSGI and not with extra application such as NGINX.
For now, I would be content if I can make the https part works.
I tried the code (with slight modification) from uwsgi site: http://uwsgi-docs.readthedocs.io/en/latest/HTTPS.html. But it does not work.
[uwsgi]
master = true
socket = 127.0.0.1:9000
shared-socket = 0.0.0.0:443
https = =0,foo.crt,foo.key,HIGH
module=project.wsgi:application
enable-threads = true
vacuum = true
die-on-term = true
From the browser, I got the site cannot be reach I have the certificate "foo.crt" and "foo.key" on the same folder as the configuration file for the code above and below. The certificate is a self sign certificate.
I also tried the following code, but only works the http and not https:
[uwsgi]
;master process with 5 workers.
master = true
processes = 5
http = :80
https = :443,foo.crt,foo.key
buffer-size = 32768
module=project.wsgi:application
enable-threads = true
vacuum = true
die-on-term = true
If you know how to make this HTTPS works that would awesome. Even better, if it also includes http redirect to https.
Thanks in advance.
Got this to work for https.
Like Oleg said, I miss that =0
[uwsgi]
;master process with 5 workers.
master = true
processes = 5
shared-socket = 0.0.0.0:443
https = =0,foo.crt,foo.key,HIGH
module=project.wsgi:application
enable-threads = true
vacuum = true
die-on-term = true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With