title: How to set up nginx to allow HTTP on LAN, and redirect and authorize on external connections
body: <p>I'm trying to setup Nginx for some personal web services I have running on my home server.</p>
  
  <p>The network is setup with router between the server and the internet, the router has a Dynamic DNS service running such that I can connect to it while not at home.</p>
  
  <p>I would like Nginx to handle connections from the local network such that it will serve the web services over <code>HTTP</code> and <code>HTTPS</code> without any authentication.</p>
  
  <p>Connections from outside the local network, should redirected to <code>HTTPS</code> for security, and should also be required to authenticate.</p>
  
  <p>The available web services are the same in the both cases. Connections directly to the IP should also be handled in the same way. I already have the web services running over HTTP, so this question is only about how to setup my <code>server</code> blocks</p>
  
  <p>Is this possible?</p>