Skip to content

Instantly share code, notes, and snippets.

@bhubr
Created January 21, 2019 22:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhubr/f7c5f932828d31958fff69de80ac79a6 to your computer and use it in GitHub Desktop.
Save bhubr/f7c5f932828d31958fff69de80ac79a6 to your computer and use it in GitHub Desktop.
Node.js + Nginx configuration on CentOS 7 (apply to /etc/nginx/nginx.conf)
--- /etc/nginx/nginx.conf.original 2019-01-21 19:39:10.556032081 +0100
+++ /etc/nginx/nginx.conf 2019-01-21 19:42:09.225622416 +0100
@@ -45,6 +45,12 @@
include /etc/nginx/default.d/*.conf;
location / {
+ proxy_pass http://localhost:8000;
+ proxy_http_version 1.1;
+ proxy_set_header Upgrade $http_upgrade;
+ proxy_set_header Connection 'upgrade';
+ proxy_set_header Host $host;
+ proxy_cache_bypass $http_upgrade;
}
error_page 404 /404.html;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment