I have backend API which like this :
http://192.168.65.203:2022/page/index.jsp
and i have Apache httpd server as a 1st layer before hit backend. I set the port as 8090.
Now i want for image file will only get from httpd server, not from backend server. So my VirtualHost look like this :
<VirtualHost *:8090>
ProxyPreserveHost On
ProxyRequests off
<Directory "/usr/share/myfile">
Options Indexes FollowSymLinks
AllowOverride None
order allow,deny
Allow from all
Require all granted
</Directory>
AliasMatch ^/(.*.gif|.*.jpg|.*.jpeg|.*.png|.*.css|.*.swf)$ /usr/share/myfile/$1
ProxyPass / http://192.168.65.203:2022/
ProxyPassReverse / http://192.168.65.203:2022/
Problem : image still pickup from backend server. If i disable proxypass and proxypassreserve, it working fine (image can load from httpd server).
Expectation : how i can control if image is found (at alias rule) it should not go for proxypass? or is there any other method?
2
Answers
Directive ! is needed. Below is the solution for my problem..
When the request is image type it will go to local file system "/usr/share/myfile" and the Directive ! is like to stop the proxy. Check here for more details for this directive.
Replace [1] by [2] and try: