title: Req.protocol is always http and not https
body: <p>I have recently migrated a NodeJS app using the Express web server from one hosting provider to another.</p>
  
  <p>Since the switch, all of my req.protocol are returning as HTTP instead of HTTPS. I have configured the SSL certificates on the new host and it is forcing SSL with .htaccess file.</p>
  
  <p>I have always had the trust proxy enabled in my application.</p>
  
  <pre><code>app.enable('trust proxy)';
  </code></pre>
  
  <p>But, I have tried disabling this but it did not solve my problem.</p>
  
  <p>The request header I am receiving with trust proxy enabled:</p>
  
  <pre><code>{ host: '127.0.0.1:58535',
  'upgrade-insecure-requests': '1',
  'user-agent':
   'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36',
  accept:
  'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*
  
  
   /*;q=0.8,application/signed-exchange;v=b3',
  'sec-fetch-site': 'none',
  'accept-encoding': 'gzip, deflate, br',
  'accept-language': 'en-US,en;q=0.9',
  cookie:
   '_ga=GA1.2.1627492895.1565633625; _gid=GA1.2.952960627.1565633625; 
   _hjid=aa79d062-c91e-483d-8654-e2d11b4b8707; _hjIncludedInSample=1',
  'if-none-match': 'W/"7d4b-dYhPiTxJki+OCl9FjTfsJQnUkSM"',
  'x-forwarded-for': 'X.X.X.X',
  'x-forwarded-host': 'example.example.com',
  'x-forwarded-server': 'example.example.com',
  connection: 'close' }
  </code></pre>
  
  <p>I am not using NGINX. Why is my app not detecting https as the protocol?</p>