Node-Red Dashboard running on Nginx port 80

After finishing my Node-Red dashboard app, and boy, it’s awesome. Everything works great, but I wanted to bind it to port 80 on my nginx server.


A more popular approach is to set up Nginx as a reverse proxy by having it bind to the desired port, forwarding all incoming traffic to my node red dashboard.

Nginx is a high performance, open source web server (similar to Apache) that is widely-used.

The main benefit of Nginx is the fact that it takes care of transport optimization.

Installing Nginx

sudo apt-get install nginx

Configuring Nginx

Next, we’ll need to configure Nginx so that it forwards traffic to my dashboard. Let’s start off by removing the default configuration file:

sudo rm /etc/nginx/sites-enabled/default

Next, create a new file in /etc/nginx/sites-available/ called node and open it with nano:

sudo nano /etc/nginx/sites-available/node

Paste the following code in the file and make sure to change to your domain (or IP), and 1880 to your Node-Red Dashboard port:

server {
    listen 80;

    location /ui {
        proxy_set_header   X-Forwarded-For $remote_addr;
        proxy_set_header   Host $http_host;
        proxy_pass         "";

The proxy_pass declaration configures Nginx to act as a reverse proxy by forwarding all incoming requests on port 80 to Node-Red dashboard on port 1880, on behalf of the client.

Next, we need to symlink our configuration to sites-enabled for it to be used by Nginx, since it’s currently in sites-available:

sudo ln -s /etc/nginx/sites-available/node /etc/nginx/sites-enabled/node

Applying the Configuration

Let’s restart Nginx so that it loads our configuration:

sudo service nginx restart


sudo service nginx status

and you should see something like:

* nginx.service - A high performance web server and a reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
   Active: active (running) since Sat 2017-02-11 14:14:14 UTC; 306ms ago
  Process: 3103 ExecStop=/sbin/start-stop-daemon --quiet --stop --retry QUIT/5 --pidfile /run/ (code=exited, status=0/SUCCESS)
  Process: 3111 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
  Process: 3108 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
 Main PID: 3113 (nginx)
   CGroup: /system.slice/nginx.service
           |-3113 nginx: master process /usr/sbin/nginx -g daemon on; master_process on;
           |-3114 nginx: worker process
           |-3115 nginx: worker process
           |-3116 nginx: worker process
           `-3119 nginx: worker process

Feb 11 14:14:14 alexapi nginx[3108]: nginx: [warn] server name "" has suspicious symbols in /etc/nginx/sites-enabled/node:3
Feb 11 14:14:14 alexapi nginx[3111]: nginx: [warn] server name "" has suspicious symbols in /etc/nginx/sites-enabled/node:3
Feb 11 14:14:14 alexapi systemd[1]: Started A high performance web server and a reverse proxy server.

All set! Nginx will now forward all incoming requests to your app and even survive a server crash, since it automatically starts up with your machine.


also see:


If you found this helpful, donate some coins

BTC: 1GLwaJiYo7NT71DFHj7KzcDjcczJUWVCbz

ETH: 0x5218b473b25Bff87f6820f3A84400cbdf3Ab85AB


Installing latest Node.js on Raspberry Pi B+

So, I’ve been battling with updating my node.js via apt-get, for some apparent reason seems like they’ve discontinued updates or maybe I’ve been doing it wrong all along – who knows.

But I found a way to bypass apt-get and go back to the basics.
Note: This assumes that the latest release is node-v7.4.0, else you can go to and get the required build.

This assumes the Raspberry Pi is running Rasbian – Jessie

# Download Node.js source Raspberry Pi Model A, B, B+ and Compute Module

wget -qO- | tar xvz
cd node-v7.4.0*

# Raspberry Pi 2 Model B

wget | tar xzv
cd node-v7.4.0-linux-armv7l

# and lastly
sudo cp -Rv * /usr/local/

# That's it! To check Node.js is properly installed and you have the right version, run the command:

node -v