Skip to content

Instantly share code, notes, and snippets.

@freshlogic
Last active March 5, 2024 17:11
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freshlogic/6348417 to your computer and use it in GitHub Desktop.
Save freshlogic/6348417 to your computer and use it in GitHub Desktop.
HACK: Azure doesn't support X-Forwarded-Proto so we add it manually
var express = require('express');
var app = express();
app.enable('trust proxy');
// HACK: Azure doesn't support X-Forwarded-Proto so we add it manually
app.use(function(req, res, next) {
if(req.headers['x-arr-ssl'] && !req.headers['x-forwarded-proto']) {
req.headers['x-forwarded-proto'] = 'https';
}
return next();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment