Skip to content

NodeJS Nginx Reverse Proxy

You can follow the guides below to install and configure Nginx and NodeJS

  1. Nginx Installation on Centos and Ubuntu
  2. NodeJS Installation on Centos and Ubuntu
  3. Assuming the NodeJS application is running on PORT->3000

Server Block Configuration for NodeJS Nginx Reverse Proxy

upstream skydevops_upstream {
	keepalive 64;

server {
	listen 80;
	root /home/shashi/;

	location / {
		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_http_version 1.1;
		proxy_set_header Upgrade $http_upgrade;
		proxy_set_header Connection "upgrade";
		proxy_max_temp_file_size 0;
		proxy_pass http://skydevops_upstream/;
		proxy_redirect off;
		proxy_read_timeout 240s;

Shashi View All

A passionate devops and automation engineer

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: