Skip to content

Commit

Permalink
Enable use behind a proxy
Browse files Browse the repository at this point in the history
The issue has been around for quite some time now. The fix seems to work for rlidwka#232 .
  • Loading branch information
vperron committed Jun 19, 2015
1 parent 93245c0 commit ff9283f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ module.exports = function(config_hash) {
// run in production mode by default, just in case
// it shouldn't make any difference anyway
app.set('env', process.env.NODE_ENV || 'production')

// for nginx proxy
if (process.env.VIRTUAL_HOST) {
app.enable('trust proxy');
}

function error_reporting_middleware(req, res, next) {
res.report_error = res.report_error || function(err) {
Expand Down

0 comments on commit ff9283f

Please sign in to comment.