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:
mod_proxy
with a2enmod proxy
./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!
Выяснилось, что в Express установлена строгая маршрутизация
, которая, например, не допускает // help
.
Решение:
Опустите завершающую косую черту в директиве ProxyPass
, например:
ProxyPass /node http://localhost:3000