diff --git a/lib/routes.js b/lib/routes.js
index <HASH>..<HASH> 100644
--- a/lib/routes.js
+++ b/lib/routes.js
@@ -28,7 +28,7 @@ const _ = require('lodash'),
  */
 function addSiteLocals(site) {
   return function (req, res, next) {
-    res.locals.url = req.protocol + '://' + req.get('host') + req.originalUrl;
+    res.locals.url = req.protocol + '://' + req.hostname + req.originalUrl;
     res.locals.site = site;
 
     next();
use X-Forwarded-Host for locals.url if exists