Need help? Call us on 1300 789 260

Plesk 12: Running mod_proxy to use node.js (or similar)

Difficulty: Advanced

Prerequisites

  • Plesk admin details for your VPS

Overview

Many of the latest web frameworks (such as Node.js) don't directly integrate into Parallels Plesk or any of the other web control panel systems. However, if you've setup the framework and have it running on your VPS, you can still take advantage of Plesk to manage your system. This is also applicable if you have a standalone application which provides a native HTTP interface and need to run it through your standard server.

One way to achieve this is to take advantage of the Apache mod_proxy to present this by proxying it through your existing website. This way, it will run on the standard port 80 and you can run other websites along side it.

Instructions

  1. After logging into Plesk, select the domain you want to add the proxy to.
  2. If it's not already expanded, select the Show More link:
    Plesk 12 - Domains - Show More
  3. Click on the Web Server Settings button in the expanded view:
    Plesk 12 - Web Server Settings
  4. Under the Additional Apache directives, you can then add the following code:
    <Location />
        ProxyPass http://localhost:4321/
        ProxyPassReverse http://localhost:4321/
    </Location>

    This assumes your Node.js (or similar backend system) is listening on port 4321 on the localhost. If you have specified a different port number in your application, you'll need to ensure it matches here. The result should look like this:
    Plesk Proxy - Apache Directives

    You can also just specify a certain directory to proxy, eg "<Location /test1>" and this will only proxy requests for /test1.

  5. Click on the OK button to save the config and force Apache to reload it. You should then be able to view your application from a browser with it being proxied through Apache.
Was this article helpful? Yes No
👥

Having trouble? We’re here to help!

We’ve built our company with a serious focus on quality service. Feel free to give us a call!

1300 789 260