title: uWSGI configuration to use HTTPS
body: <p>I need to have uWSGI to only allow connection through https.
  I can only use uWSGI and not with extra application such as NGINX.</p>
  
  <p>For now, I would be content if I can make the https part works.</p>
  
  <p>I tried the code (with slight modification) from uwsgi site: <a href="http://uwsgi-docs.readthedocs.io/en/latest/HTTPS.html" rel="nofollow noreferrer">http://uwsgi-docs.readthedocs.io/en/latest/HTTPS.html</a>. But it does not work. </p>
  
  <pre><code>[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
  </code></pre>
  
  <p>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.</p>
  
  <p>I also tried the following code, but only works the http and not https:</p>
  
  <pre><code>[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
  </code></pre>
  
  <p>If you know how to make this HTTPS works that would awesome.
  Even better, if it also includes http redirect to https.</p>
  
  <p>Thanks in advance.</p>