Having an application running on port 10001 I would like to have a reverse proxy to serve it on hostname/ds
. The only problem is that there are hard linked scripts to /scripts/...
That means hostname/ds/
shall get me to localhost:10001/
and hostname/scripts
should first rewrite the request url to hostname/ds/scripts/*
.
My configuration:
<VirtualHost *:80>
RewriteEngine on
RewriteRule /^scripts/(.*)$ /ds/scripts/$1 [L,PT]
ProxyPass /ds/ http://127.0.0.1:10001/
ProxyPassReverse /ds/ http://127.0.0.1:10001/
</VirtualHost>
It does not work: hostname/scripts/
gets a 404. while hostname/ds/scripts/
gets the right answer by the application.
According to https://stackoverflow.com/questions/9003358/apache-rewrite-then-proxy-pass PT
should work.
What am I doing wrong?