title: How to properly setup nginx as a reverse proxy for gunicorn and flask using subdomains, for both SSL and non-SSL configurations?
body: <p>Could someone please post an nginx configuration file that shows how to properly route the following URLs to to gunicorn:</p>
  
  <ol>
  <li><a href="http://www.example.com" rel="nofollow">http://www.example.com</a></li>
  <li><a href="https://www.example.com" rel="nofollow">https://www.example.com</a></li>
  <li><a href="http://testing.example.com" rel="nofollow">http://testing.example.com</a></li>
  <li><a href="https://testing.example.com" rel="nofollow">https://testing.example.com</a></li>
  </ol>
  
  <p>Some questions:</p>
  
  <ol>
  <li>why do some nginx configuration files contain an "upstream command?"</li>
  <li>I am running 2N+1 gunicorn workers. Would I also need multiple nginx workers? by that, I mean should I even the "worker_processes" command since nginx is just supposed to serve static files?</li>
  <li>how to setup buffering/caching?</li>
  </ol>