Janik von Rotz

1 min read

Node.js Nginx proxy website

This post is part of my Your own Virtual Private Server hosting solution project.
Get the latest version of this article here: https://gist.github.com/9407504.


It’s recommanded to publish a Node.js application with a Nginx proxy website.



Add this Nginx config to one of your website.

server {

    location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $http_host;

Where proxy_pass port is the must be equal with the port of the Node.js application.

Restart the Nginx service.

sudo service nginx restart

Categories: Web server
Tags: application , javascript , nginx , nodejs , proxy , security , website
Improve this page
Show statistic for this page