Как настроить Apache ProxyPass для сохранения экспресс-маршрутов

В моем конфиге Apache я перенаправляю весь трафик на/node в порт3000где сервер Express слушает.

<IfModule mod_proxy.c>

  ProxyRequests Off

  ProxyPass /node http://localhost:3000/

</IfModule>

Приложение Express выглядит так:

var express = require('express');

var app = express();
var router = express.Router();

router.route('/route/:id').get(function (req, res) {

    res.json({ description: 'Welcome to a route with an ID' }); 
});

router.route('/route').get(function (req, res) {

        res.json({ description: 'Welcome to the normal route' }); 
});

router.route('/').get(function (req, res) {

    res.json({ data: 'Welcome to the app' }); 
});

app.use('/', router);

app.listen(3000);

Когда я направляю свой браузер наhttp://myserver.com/node Я получаю ответ{ data: 'Welcome to the app' }это нормально. Хотя, когда я пытаюсь пойтиhttp://myserver.com/node/route или жеhttp://myserver.com/node/1210 Я получаю ошибкуCannot GET //route.

Любые идеи, как я могу обновить мою конфигурацию Apache, чтобы сохранить маршруты Express?

Я использую Apache 2.4.6 на CentOS.

Ответы на вопрос(1)

Ваш ответ на вопрос