title: Laravel configurate force https
body: <p>Our website is hosted on a load balanced server. SSL offloading is done on the firewall, so the client is reverse proxied to the web server farm.</p>
  
  <p>When the https request reaches our Laravel app, the server variable HTTPS is empty and Laravel doesn't seem to detect the https mode and generates urls (assets &amp; routes) as:</p>
  
  <ul>
  <li><a href="http://www.somesite.be:443/assets/" rel="nofollow">http://www.somesite.be:443/assets/</a></li>
  <li><a href="http://www.somesite.be:443/nl-BE/about" rel="nofollow">http://www.somesite.be:443/nl-BE/about</a></li>
  </ul>
  
  <p>Is there a way to configure Laravel to force the url's to generate https links?
  We prefer to have a configuration solution because we have a development and staging environment that aren't running under https.</p>
  
  <p>Notice:
  We already tried the "trustedproxy" approach from fideloper, and this resulted in no change.
  I presume that a .htaccess rewrite is not an option since htaccess rewrites are based on the same https header (we don't receive) or port (80, laravel calls port 443).</p>
  
  <p>Thanks for the help.</p>