Skip to content

Instantly share code, notes, and snippets.

@dexterbrylle
Created May 2, 2016 17:27
Show Gist options
  • Save dexterbrylle/213e9622b982e0bd3c0605c8fcbf9a25 to your computer and use it in GitHub Desktop.
Save dexterbrylle/213e9622b982e0bd3c0605c8fcbf9a25 to your computer and use it in GitHub Desktop.
Nginx config for MEAN stack
upstream someserver {
server 127.0.0.1:5000;
keepalive 16;
}
server {
listen 80;
server_names someserver.com www.someserver.com;
access_log /var/log/nginx/someserver.log;
location / {
root /var/www/someserver/public/;
index index.html index.htm;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-NginX-Proxy true;
proxy_pass http://somerserver;
proxy_redirect off;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment