Skip to content

Node.js based forum software built for the modern web

Fixed #3925

Julian Lamf77f39e937cf
diff --git a/src/webserver.js b/src/webserver.js
index 87b9f1a8cc..8bbf914a40 100644
--- a/src/webserver.js
+++ b/src/webserver.js
@@ -121,7 +121,7 @@ function cacheStaticFiles(callback) {
}
function listen(callback) {
- var port = nconf.get('port');
+ var port = parseInt(nconf.get('port'), 10);
if (Array.isArray(port)) {
if (!port.length) {
@@ -138,7 +138,7 @@ function listen(callback) {
}
}
- if (port !== 80 && port !== 443 && nconf.get('use_port') === false) {
+ if ((port !== 80 && port !== 443) || nconf.get('trust_proxy') === true) {
winston.info('Enabling \'trust proxy\'');
app.enable('trust proxy');
}