env/ debug
This commit is contained in:
12
server.js
12
server.js
@ -73,12 +73,12 @@ app
|
||||
if (process.env.SSL_ENABLED === "true") {
|
||||
console.log("SSL_ENABLED = true");
|
||||
// Redirect from http to https
|
||||
server.use((req, res, next) => {
|
||||
if (req.headers['x-forwarded-proto'] !== 'https') {
|
||||
return res.redirect(`https://${req.headers.host}${req.url}`);
|
||||
}
|
||||
next();
|
||||
});
|
||||
// server.use((req, res, next) => {
|
||||
// if (req.headers['x-forwarded-proto'] !== 'https') {
|
||||
// return res.redirect(`https://${req.headers.host}${req.url}`);
|
||||
// }
|
||||
// next();
|
||||
// });
|
||||
if (process.env.SSL_KEY && process.env.SSL_CERT) {
|
||||
const options = {
|
||||
key: fs.readFileSync(process.env.SSL_KEY),
|
||||
|
Reference in New Issue
Block a user