Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So i proxied a page (on server abc so that xyz would be the proxy):

ProxyPass /activation http://xyz.com:88/activation
ProxyPassReverse /activation http://xyz.com:88/activation

So when you load xyz page on server abc, abc is displayed in address bar.

Problem is all the css, javascript, and images need for page are not proxied, so browser shows this:

GET http://abc.com/javascripts/jquery_ujs.js?1330619664 404 (Not Found)
GET http://abc.com/javascripts/addclear.js?1330619664 404 (Not Found)
GET http://abc.com/javascripts/jquery.truncate.js?1330619664 404 (Not Found)
GET http://abc.com/javascripts/jquery.min.js?1330619664 404 (Not Found)
GET http://abc.com/javascripts/jquery-ui.min.js?1330619664 404 (Not Found)
GET http://www.staticvoid.info/toggleEdit/toggleEdit.css 404 (Not Found)
GET http://abc.com/javascripts/jquery.dateFormat-1.0.js?1330619664 404 (Not Found)
GET http://abc.com/javascripts/jquery.tablesorter.min.js?1330619664 404 (Not Found)
GET http://abc.com/javascripts/rails.validations.js?1330619664 404 (Not Found)
GET http://abc.com/javascripts/rails.validations.custom.js?1330619664 404 (Not Found)
GET http://abc.com/javascripts/application/initializers.js?1330619664 404 (Not Found)
GET http://abc.com/javascripts/jquery.multiselect.js?1330619664 404 (Not Found)
GET http://abc.com/javascripts/application/toolbox.events.js?1330619664 404 (Not Found)
GET http://abc.com/stylesheets/formtastic.css?1330619664 404 (Not Found)
GET http://abc.com/stylesheets/formtastic_changes.css?1330619664 404 (Not Found)
GET http://abc.com/stylesheets/jquery.multiselect.css?1330619664 404 (Not Found)
GET http://abc.com/stylesheets/jquery.tooltip.css?1330619664 404 (Not Found)
GET http://abc.com/themes/abc/stylesheets/abc.css 404 (Not Found)
GET http://abc.com/themes/abc/stylesheets/reset.css 404 (Not Found)
GET http://abc.com/javascripts/application.js?1330619664 404 (Not Found)
GET http://abc.com/themes/abc/stylesheets/login.css 404 (Not Found)
GET http://abc.com/stylesheets/blueprint/screen.css?1330619664 404 (Not Found)
GET http://abc.com/stylesheets/application.css?1330619664 404 (Not Found)
GET http://abc.com/themes/abc/stylesheets/style.css 404 (Not Found)
GET http://abc.com/themes/abc/images/callnow.jpg 404 (Not Found)
GET http://abc.com/themes/abc/images/eagletrackgps.jpg 404 (Not Found)
GET http://abc.com/themes/abc/images/madeinamerica.jpg 404 (Not Found)
GET http://abc.com/images/btn-abc.jpg?1330619664 404 (Not Found)
GET http://abc.com/images/btn-abc.jpg?1330619664 404 (Not Found)
GET http://abc.com/images/btn-abc.jpg?1330619664 404 (Not Found)
GET http://abc.com/images/btn-abc.jpg?1330619664 404 (Not Found)
GET http://abc.com/stylesheets/blueprint/print.css?1330619664 404 (Not Found)

So I tried ProxyPassMatch directive:

ProxyPassMatch /^(javascripts|stylesheets)$/^(.*)$  http://xyz.com:88/$1/$2

But it didnt work. That above directive should have removed this error, for example:

GET http://abc.com/javascripts/jquery_ujs.js?1330619664 404 (Not Found)

After all, that above request matches the url pattern match.

thanks for response

UPDATE:: Got it working when I fixed the regex:

ProxyPassMatch ^/(javascripts|stylesheets)/(.*)$ http://abc.com:88/$1/$2
share|improve this question
    
Look at ProxyPassMatch (httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypassmatch) if you want to use regex. –  KM. Mar 7 '12 at 18:23
    
I notice with proxypassmatch that the regex is always on left side, but i assume its ok if i put regex on right side. –  JohnMerlino Mar 7 '12 at 18:29
    
If you mean something like ProxyPassMatch /activation(.*) http://abc.com:88/activation$1 then yes -- notice the regex operators (.*) on the left and the corresponding $1 on the right. –  KM. Mar 7 '12 at 18:31
    
I mean something like this: ProxyPassMatch /activation abc.com:88^(activation|\.gif|\.png|\.jpg|\.jpeg|\.js|\.css)$ –  JohnMerlino Mar 7 '12 at 18:33
    
In my example, the regex is on the right side because if user is on server a then when we proxy server b i want to make sure that not only activation page on server b is proxied but all js, css, and image files on server b are proxied as well. –  JohnMerlino Mar 7 '12 at 18:35
show 2 more comments

1 Answer

up vote 0 down vote accepted

With KM01 recommendation to use proxypassmatch, I resolved this issue:

ProxyPassMatch ^/(javascripts|stylesheets)/(.*)$ http://abc.com:88/$1/$2
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.