0

I have an Ubuntu 14.04 x86 droplet on DigitalOcean with Apache 2.4.7 (the default from Ubuntu repositories). Also, I have a Node.js app running on port 3000, and want to map /node* path on root to /* the Node.js server (using Express).

What I tried:

  • Enabled mod_proxy with a2enmod proxy.
  • Modify /etc/apache2/sites-available/000-default.conf and added a line with ProxyPass /node http://localhost:3000/ to the end of VirtualHost.

What I get:

  • /node proxied to http://localhost:3000/.
  • /node/help proxied to http://localhost:3000/ (which is not right).

Are there any other modifications I should do in order to do that? Thanks in advance!

1 Answer 1

1

Figured out I had strict routing set in Express, which doesn't tolerate //help for example.

The solution: Omit trailing slash in ProxyPass directive, like so:

ProxyPass /node http://localhost:3000 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.