You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Marc Dreher <Ma...@gmx.net> on 2003/05/20 18:12:25 UTC

[users@httpd] Redirecting requests, proxy.pac file

Hi,

Background:
We are using a central proxy configuration file proxy.pac to redirect users
to different squid proxies. The file is distributed via apache.
Users should have the DNS name of the distribution server for the .pac file
configured in their browsers.
Now we have set up a new distribution server for the proxy.pac file and
changed the DNS to point to the new IP address. But there is still a lot of
traffic on the old server, so lots of people have the IP configured instead of the
name.

Now the problem:
We want to show an html error messages when peoples browsers fetch the old
proxy.pac file, stating that the server is outdated and that they should
correct their proxy configuration settings.
I tried the following:
- remove the proxy.pac file and configure apache to show a custom error page
(via ErrorDocument directive)
- redirect to a custom error page when requesting the proxy.pac file (via
Redirect directive)

Nothing of that worked. Using redirect I can see in the log that the custom
html file is requested but it is not shown in the browser. The problem is,
that no html (error) page is shown, if the proxy.pac file is requested via the
browsers automatic proxy configuration method. Only a Alert window pops up
stating that whatever page I was requesting could not be found. If I put the
URL of the proxy.pac file into the URL line in the browser I get the error
message or redirection.

Does anybody have an idea on how to solve this problem? Can I configure
something inside the proxy.pac file to achive this?

Thanks for any hints

Cheers
Marc

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage!


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Redirecting requests, proxy.pac file

Posted by Zac Stevens <zt...@cryptocracy.com>.
Hi Marc,

On Tue, May 20, 2003 at 06:12:25PM +0200, Marc Dreher wrote:
> We want to show an html error messages when peoples browsers fetch the old
> proxy.pac file, stating that the server is outdated and that they should
> correct their proxy configuration settings.

The short answer is that you cannot.  Although it is being fetched by HTTP,
the client expects to receieve a javascript file that it can use to figure
out the appropriate proxies.  How the browser handles unexpected input is
entirely up to it - but in my experience, most will either fail silently or
give a not-entirely-obvious error message.

One way to solve the problem would be to update the proxy.pac on the old
server to point to a webserver that returns your custom error page instead
of proxying requests.  The effect of this would be that the user could no
longer surf to anything using a proxy until they pointed to the new 
proxy.pac and reloaded.


Cheers,


Zac

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org