Last active
March 5, 2024 17:11
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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