Rewrite Rule before Proxypass

you have a typo in your pattern, try ^/ instead of /^ (latter will never match)


You can also do this by simply adding a second ProxyPass to match /scripts, like so:

<VirtualHost *:80>
    ProxyPass /scripts/ http://127.0.0.1:10001/
    ProxyPassReverse /scripts/ http://127.0.0.1:10001/

    ProxyPass /ds/ http://127.0.0.1:10001/
    ProxyPassReverse /ds/ http://127.0.0.1:10001/
</VirtualHost>

I know this thread is already solved but it seems that you are trying to use ProxyPass to reach the web interface of a Synology DiskStation. For anyone who faced the same problem, with the latest version (DSM 5.1-5004 Update 2) I had to use the following config with the following RewriteRules:

<VirtualHost *:80>
    RewriteRule ^/scripts/(.*)$ /ds/scripts/$1 [L,PT]
    RewriteRule ^/webfm/(.*)$ /ds/webfm/$1 [L,PT]
    RewriteRule ^/webapi/(.*)$ /ds/webapi/$1 [L,PT]
    RewriteRule ^/webman/(.*)$ /ds/webman/$1 [L,PT]

    ProxyPreserveHost On
    ProxyRequests Off
    ProxyVia Off
    ProxyPass /ds/ http://192.168.1.10:5001/
    ProxyPassReverse /ds/ http://127.0.0.1:5001/
</VirtualHost>

This obviously is subjected to change with newer versions of DS. I found using FireBug very helpful when searching for the folders that DS requests (that needed to be redirected).

Tags:

Apache 2.4