0

I have a vague understanding how to do this, keep in mind when u laugh of me.

I have a running node.js site. This app runs on port 5000, in a server where there's already apache installed, someone decide to use WordPress home page (because of themes wp have).

Mi application is something like this

var express = require('express') 
var   app = express() // respond with "hello world" when a GET request is made to the homepage 
app.get('/', function (req, res) { res.send('hello world') })

I am aware the existance of http-proxy but the rest of my knowledge doesn't get me to where I would like.

Also check this answer in here proxy node

But not sure how I would set wordpress home page ONLY to my app. Also WordPress has a installing process in routes like wp-admin.

Questions

How can I use only wordpress home page "/" replacing the one I have in my nodejs app considering what I have. Can some explain steps I need to follow? Should I also set proxy to wp routes like "wp-admin" so I could make WordPress installation?

MikZuit
  • 684
  • 5
  • 17

1 Answers1

0

It seems best solution for this is set proxypass for node api. this bellow will set wordpress folder as root then set a location for your node api with proxypass

 <VirtualHost *:443>
  ServerName domain.name.com
  DocumentRoot /var/www/html/wordpress

  <Proxy *>
        Require all granted
  </Proxy>

 <Location /node/>
   ProxyPass http://localhost:5000/
    ProxyPassReverse http://localhost:5000/
  </Location>
 ...
 </VirtualHosts>
MikZuit
  • 684
  • 5
  • 17