title: Why run Varnish on port 80 for an HTTPS only setup?
body: <p>In nearly every example I've seen for setting up Varnish with nginx and SSL support, the setup is Varnish running on port 80, nginx on port 443 for SSL termination and nginx running on another port doing the actual work communicating with the backend.</p>
  
  <p>Given most websites now redirect port 80 to 443, what advantage is there in having Varnish running on port 80?</p>
  
  <p>Why wouldn't you have nginx running on port 80, doing the 301 to the HTTPS version, nginx running on port 443 doing the SSL termination and proxying to Varnish, which is running on a different port, with nginx again running on another port doing the actual work?</p>
  
  <p>HTTP: nginx [80] (301)</p>
  
  <p>HTTPS: nginx [443] &lt;> Varnish [6081] &lt;> nginx [8080] &lt;> backend</p>
  
  <p>I really can't see any merit in having Varnish on port 80 front of house just to do a redirect. Unless, there's some problem with redirects and the unwanted addition of port numbers to URLs? Maybe adding 3 nginx server blocks is adding "more" work to the setup, but then having to configure Varnish to redirect port 80, unless it's internal, seems like "more" work.</p>
  
  <p>Bonus question: Why is Apache added to the mix in most of these setups when nginx is already in use and visa-versa? They can both handle SSL termination and proxying.</p>