[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Mod_Proxy + 302 Redirects

Posted on 2004-11-02
7
Medium Priority
?
1,793 Views
Last Modified: 2012-05-05
I'm running into problems using mod_proxy in a reverse proxy configuration where an application on the real servers are sending "302 Found"/Redirects that redirect to the real servername, and break out of the proxy scenario.

Are there any workarounds for this?

        ProxyPass /sub http://realserver
        ProxyHTMLURLMap http://realserver /sub
        Redirect /sub http://proxyserver/sub/
        <Location /sub>
                ProxyPassReverse /
                SetOutputFilter  proxy-html
                ProxyHTMLURLMap  /          /sub/
                ProxyHTMLURLMap  /sub      /sub/
        </Location>

"http://proxyserver/sub/" proxies for "http://realserver/", but realserver sends back 302 Found, Location: http://realserver/differentsub/" which ProxyPassReverse misses, and, since there is no access to realserver from the internet, causes the page not to be found.
0
Comment
Question by:Chireru
  • 3
  • 2
  • 2
7 Comments
 
LVL 38

Expert Comment

by:yuzh
ID: 12480322
Need to enable "rewrites in the HTTP Headers"

Please read the following doc:

http://www.apacheweek.com/features/reverseproxies

and fix your problem.

0
 
LVL 5

Author Comment

by:Chireru
ID: 12482705
Read that doc before, actually, most of my configuration is based off of that.  Commands that aren't shown there are in the general config, which is too long to post.
0
 
LVL 38

Expert Comment

by:yuzh
ID: 12489665
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
LVL 5

Author Comment

by:Chireru
ID: 12493665
If you look at my configuration above, I use both ProxyPass and ProxyPassReverse..  if you look at the first link you suggested to me (http://www.apacheweek.com/features/reverseproxies), that is what I mainly followed.  I have tried using the ProxyPassReverse outside of the Location directive, but the problem still exists.

I know ProxyPassReverse is working, because if I remove it, the rest of the proxy breaks.

I have all but abandoned this project for now.  I may revisit it later, if I can find a solution to this issue, but unfortunately, with this 302 problem, it cannot be deployed.
0
 
LVL 3

Expert Comment

by:andYetAnotherLoginName
ID: 12553882
wonder why the redirect is a problem, unless clients don't use your server as proxy. are you trying to steal content ;) if so you better use server-side scripting for that.
0
 
LVL 5

Author Comment

by:Chireru
ID: 12554416
The idea is: I have a whole bunch of internal servers, who's content I want to provide to users, but I want to add security to the mix too.  So, I firewall off everything except for this box, which will accept secure and insecure connections, and use the application servers behind the firewall, hopefully with at-proxy URL filtering and other fancy security options.. once I get it working.

The problem is:  some of the application servers send a 302-Redirect, which includes the full servername and path, which isn't rewritten by the proxy, and sends the user looking for some internal server (which they won't be able to get to).
0
 
LVL 3

Accepted Solution

by:
andYetAnotherLoginName earned 1500 total points
ID: 12554567
how about using mod_headers to unset/reset headers?
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
Is your organization moving toward a cloud and mobile-first environment? In this transition, your IT department will encounter many challenges, such as navigating how to: Deploy new applications and services to a growing team Accommodate employee…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Suggested Courses
Course of the Month9 days, 9 hours left to enroll

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question