Articles in this section

How to create Nginx reverse proxy for Node.js application and let Nginx handle SSL on Plesk server?

kb: how-to Plesk Obsidian for Linux

Applicable to:

  • Plesk Obsidian for Linux

Question

How to create Nginx reverse proxy for Node.js application and let Nginx handle SSL on Plesk server?

Answer

If the Node.js and the application are configured via Plesk, as per this article: How to run Node.js application via Plesk, no further configuration is required. Nginx will act as a proxy serving HTTPS requests to the application on port 443.

Click on a section to expand

In case Node.js/application is configured manually
  1. Log into Plesk

  2. Uncheck PHP Support option at Domain > example.com > Dashboard > PHP
  3. Uncheck Proxy mode option at Domain > example.com > Hosting & DNS > Apache and Nginx Settings.
    mceclip1.png

  4. Configure Nginx to forward all HTTPS requests made to the app domain URL to the port in which Node.js app is listening (in this example port 5500), adding the following additional directive below at Domains > example.com > Apache & Nginx Settings > Additional Nginx directives

    CONFIG_TEXT: location / {
    proxy_set_header X-Forwarded-For $remote_addr;
    proxy_set_header Host $http_host;
    proxy_pass http://127.0.0.1:5500;
    }

  1. Click Apply button.
Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.