logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Apache 2.4 mod_rewrite and Location ProxyPass
Author
rustamabd



Joined: 11 Oct 2015
Posts: 1

PostPosted: Sat 17 Oct '15 13:43    Post subject: Apache 2.4 mod_rewrite and Location ProxyPass Reply with quote

I'm having a hard time getting mod_rewrite and mod_proxy work together.

My config looks like this:

Code:
RewriteEngine On
RewriteRule ^/data/(images/.*) /data-server/$1 [PT]
<Location /data/>
    ProxyPass ajp://localhost:8009/data/
    Order Deny,Allow
    Allow from all
</Location>
<Location /data-server/>
    ProxyPass ajp://localhost:8009/data-server/
    Order Deny,Allow
    Allow from all
</Location>


The intention is that first the URI is rewritten, and then the rewritten URI is proxied to the corresponding backend.

But it is not working. After the RewriteRule (even with passthrough flag), httpd is looking for the file in htdocs, ignoring the ProxyPass directive.

Is there a way to do a real passthrough in a rewrite, to force httpd to follow all of the logic, including Location and ProxyPass sections?
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7371
Location: Germany, Next to Hamburg

PostPosted: Sat 24 Oct '15 13:34    Post subject: Reply with quote

Why don't you change it to

Code:

<Location /data/images/>
    ProxyPass ajp://localhost:8009/data-server/
    Order Deny,Allow
    Allow from all
</Location>
<Location /data/>
    ProxyPass ajp://localhost:8009/data/
    Order Deny,Allow
    Allow from all
</Location>
Back to top


Reply to topic   Topic: Apache 2.4 mod_rewrite and Location ProxyPass View previous topic :: View next topic
Post new topic   Forum Index -> Apache