Skip to content

Instantly share code, notes, and snippets.

@nairihar
Last active April 28, 2018 11:25
Show Gist options
  • Save nairihar/6d23f56b43e5de486522ceba148cbb75 to your computer and use it in GitHub Desktop.
Save nairihar/6d23f56b43e5de486522ceba148cbb75 to your computer and use it in GitHub Desktop.
NodeJS with NGINX Plus, medium, nginx plus conf
upstream api {
zone api 64k;
server 127.0.0.1:3000;
server 127.0.0.1:3001;
}
server {
listen 8080;
location / {
proxy_pass http://api;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /upstream_conf {
allow 10.0.0.0/8; # Allow access only from LAN
deny all; # Deny everyone else
upstream_conf;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment