public
Last active

HACK: Azure doesn't support X-Forwarded-Proto so we add it manually

  • Download Gist
app.js
JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13
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();
});

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.