Nginx is a high performance web server. Some said it is better than Apache. Nginx can be used as reverse proxy for Node.js server application. And also as static file server since it’s very efficient. If you are have a VPS or VM running, you can use Nginx as front for more than one Node.js app.
First, you have to install Nginx first. My standard script for installing development server is available here. Once you have nginx setup, when you access your server on port 80, you will see nginx welcoming screen.
Here, I assume you already have a Nodejs app running. Use forever or pm2 for production server.
Remove the default site file. You can choose to keep this, just make sure the server_name is different.
Create new file for your site
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Save and close the nano text editor. Make sure you have created logs folder as shown above.
Then create a symbolic link from
Check your site file
If there are error, nginx will tell you.
Access your server on port 80 using your favorite browser. There is your nodejs app.