I'd like to know how to use Apache as a reverse proxy for a specific path and as local server for its sub-paths.
For a specific location, I am using Apache as a reverse proxy (https://my.server.com/my-tools):
<Location /my-tools>
Order allow,deny
Allow from all
ProxyPass http://10.1.1.11:3101/my-tools
ProxyPassReverse http://10.1.1.11:3101/my-tools
</Location>
The thing is that for its assests I'd like to use the local server (https://my.server.com/my-tools/images/). I have tried adding Alias with no success:
Alias /my-tools/images/ /home/myself/public/images/
<Directory /home/myself/public/images/>
Order allow,deny
Allow from all
</Directory>
I tried also to add this, but it didn't work either:
<Location /my-tools/images/>
SetHandler None
</Location>
It keeps redirecting to the remote server when I enter https://my.server.com/my-tools/images/myimage.png, for example.
ProxyPassout of the Location directive to make it work. Note: you need to putProxyPass !before theProxyPass http://...". Also,Aliascan't be placed inside Location.<Location>in the official documentation, but there's a limitation: "If theAliasdirective is used within a<Location>or<LocationMatch>section the URL-path is omitted, and the file-path is interpreted using expression syntax. This syntax is available in Apache 2.4.19 and later." – Esa Jokinen May 28 '17 at 04:49Alias not allowed here. – Adriano P May 29 '17 at 04:27