I have an Apache reverse-proxy server set up between a client machine and a server. What I want to achieve is to override a javascript file sent from the server with the one from the proxy before sending the file to the client. I don't want to change the javascript file at the server because I want the proxy to be transparent. Is there a possible way to do this?
Asked
Active
Viewed 753 times
1 Answers
0
Assuming you're using a the ProxyPass
Apache directive you can exclude certain sub directories and file system paths from being forwarded by using an exclamation mark !
. That will allow you to serve them from the local file system on the proxy server instead.
# Exclude file.js and serve that from the local filesystem
ProxyPass /app/dir/file.js !
# proxy /app to internal server
ProxyPass /app http://int.example.com/app
ProxyPassReverse /app http://int.example.com/app

HBruijn
- 77,029
- 24
- 135
- 201
-
Exactly what I was looking for. Thank you so much. – Wai Yan Jul 11 '14 at 01:22