Search code examples
node.jsapachereverse-proxyports

Running both Node.js and Apache on the same domain and "URL"


Is it possible to run Both node and Apache on the same domain without adding the port in the URL ? and serve both on the same page, i already have node running on port 8443 and Apache on port 433 and they both work fine but i need to specify in the link the port "8443" to access node which is not what i want, i want to serve both on the same URL if possible without adding the port to the URL.


Solution

  • You can use Apache reverse proxy

    Add this configuration to your apache conf.

    ProxyPass "/nodeapp" "http:/localhost:8443"

    You can access node application by http://www.example.com/nodeapp

    A reverse proxy is a type of proxy server that retrieves resources on behalf of a client from server. These resources are then returned to the client as if they originated from the web server itself.