Skip to content

Commit

Permalink
Enable use behind a proxy -> rlidwka#268
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaël Reyrol committed May 25, 2016
1 parent 9bbb241 commit dafa936
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 @@ -21,6 +21,11 @@ module.exports = function(config_hash) {
// 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) {
if (err.status && err.status >= 400 && err.status < 600) {
Expand Down

0 comments on commit dafa936

Please sign in to comment.