Skip to content

Instantly share code, notes, and snippets.

@EcutDavid
Last active October 8, 2015 05:33
Show Gist options
  • Save EcutDavid/cba5087f0e631777d4fa to your computer and use it in GitHub Desktop.
Save EcutDavid/cba5087f0e631777d4fa to your computer and use it in GitHub Desktop.
Node programming tips.

Common question

express

  • trust proxy: Set trust proxy to true if your Node.js app is working behind reverse proxy such as Varnish or Nginx. This will permit trusting in the X-Forwarded-* headers, such as X-Forwarded-Proto (req.protocol) or X-Forwarder-For (req.ips). The trust proxy setting is disabled by default.
app.set('trust proxy', true);  //same result
app.enable('trust proxy');//same result

node ntlmaps config

> npm config set proxy http://localhost:53128
> npm config set https-proxy http://localhost:53128
> npm config set registry http://registry.npmjs.org
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment