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.

I have a Rails instance running on port 3001 on my machine and I want to proxy it through Apache on port 3002 letting Apache serve the static files located under assets, so that http://127.0.0.1:3002/some/action is served by Rails and http://127.0.0.1:3002/assets/some_image.jpg is served by Apache itself.

The relevant parts of Apache's https.conf are:

Listen 3002

LoadModule alias_module modules/mod_alias.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule rewrite_module modules/mod_rewrite.so

ProxyPass /assets !
Alias /assets "D:/temp/assets"

ProxyRequests Off
ProxyPass        / http://localhost:3001/
ProxyPassReverse / http://localhost:3001/

<Location "/">
  # Configurations specific to this location. Add what you need.
  # For instance, you can add mod_proxy_html directives to fix
  # links in the HTML code. See link at end of this page about using
  # mod_proxy_html.

  # Allow access to this proxied URL location for everyone.
  Order allow,deny
  Allow from all
</Location>

<Directory />
    Options FollowSymLinks
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

<Directory "D:/temp/assets">
    # directives to effect the static directory
    # Options +Indexes
    Order deny,allow
    Allow from all

</Directory>

While the dynamic pages are returned correctly, assets raise a 404-not found status. Any help? Thanks

share|improve this question
    
Since it's the non-proxy directory that you are getting the 404 with, try removing all the Proxy directives and confirming that you can get to localhost:3002/assets/some_asset_name first, then go back and add the proxy directives. –  richardneish Oct 25 '12 at 15:17
    
Use Phusion Passenger? –  Michael Hampton Oct 25 '12 at 16:20
    
There should be an entry in the error log when the 404 happens, what's it say? –  Shane Madden Oct 25 '12 at 22:46
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.