Issue in getting data from node server (redirecting from php to node using mod proxy)

Viewed 29

<VirtualHost *:80>

ServerName my_domain_name


DocumentRoot /var/www/html
<Location /node/>
    ProxyPass        http://my_domain_name:1341/
    ProxyPassReverse http://my_domain_name:1341/
</Location>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

I am redirecting to the node server that is hosted on http://my_domain_name:1341/ Actually, I am plotting Gantt charts using a free library in node js.

What happens actually in my node server It gets a response from further http://my_domain_name:1341/data

Now, the problem is coming when I am redirecting using a mod proxy to http://my_domain_name:1341/

It is able to redirect but data is coming on default port 80 like this http://my_domain_name/data And I am getting a link not found error. Can anyone suggest a workaround for this issue? Thank you!

1 Answers

I am able to fix this issue by adding one more route in my reverse proxy of data.

    <Location /node/data> 
    ProxyPass my_domain_name:1341/data
    ProxyPassReverse my_domain_name:1341/data 
    </Location> 
Related