• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue How to configure the WordPress and Nodejs together on a single domain?

piyushmittal

New Pleskian
Hi all,

I am working on two different projects, one project is in Nodejs, and the other is in WordPress and I am trying to deploy both projects together with the use of Plesk panel on a single domain. We want our node project should run on <our_domain>/ and if we got to <our_domain>/blog then we want to run the WordPress project. We successfully configured Node project on <our_domin>/ and then we created a blog directory inside of our node project public folder and then we migrated our whole WordPress code into the blog directory but when we try to go on <our_domain>/blog instead of opening the WordPress website blog page we got redirected to <our_domian>/. And we don't have any idea why this is happening.

We are using:
  • Apache.
  • NodeJs 14.
  • PHP version 7.4.27.
If anyone knows how to solve this problem please reply in this thread.

Thanks
 
I found a solution after digging through the inner workings of the plesk apache and nginx config

It's pretty straightforward, configure your nodejs application like it was your main app, enable php

Thrn in the Web hosting settings of Apache, for https add this (replace yourpath_to_wp_dir and your_domain.example.com):

Apache config:
Alias /blog /var/www/vhosts/yourpath_to_wp_dir

<Directory /var/www/vhosts/yourpath_to_wp_dir>
    <IfModule mod_proxy_fcgi.c>
        <Files ~ (\.php$)>
            SetHandler proxy:unix:/var/www/vhosts/system/your_domain.example.com/php-fpm.sock|fcgi://127.0.0.1:9000
        </Files>
    </IfModule>

    SSLRequireSSL

    Options -Includes -ExecCGI
</Directory>


And that's all there is to it, your node app is served at the root and /blog serves the wordpress php app
 
Back
Top