Re: [squid-users] Reverse proxy with URL rewriting

From: Mathieu Kretchner <mathieu.kretchner@dont-contact.us>
Date: Tue, 06 May 2008 09:38:56 +0200

Thanks for your help!
I try to determine an easy solution to setup up a reverse proxy and I'm
thinking that installing reverse proxy is more easy with reverse proxy
apache than with squid.
But maybe, I'm not familiar with the squid syntax.

Sylvain Beaux a écrit :
> Thank you for the explanations. I made squid working with url rewriting.
>
> But i've got an other problem, each web server use cookies methods and I
> need to rewrite the Cookie path too. Is it possible ? I didn't find a
> solution on the FAQ.
> example :
> Web server1 >> squid :
> HTTP/1.1 200 OK
> Set-Cookie: cookie=[Token]; Path=/
>
> squid >> user:
> HTTP/1.1 200 OK
> Set-Cookie: cookie=[Token]; Path=/serv1
>
>
> Mathieu:
> That's my configuration:
> _squid.conf_
>
> http_port <pub-ip>:80 vhost no-connection-auth
>
> acl serv1-path urlpath_regex \/serv1(\/|$)
> acl serv2-path urlpath_regex \/serv2(\/|$)
>
> url_rewrite_host_header off
>
> acl all src 0.0.0.0/0.0.0.0 <http://0.0.0.0/0.0.0.0>
>
> acl manager proto cache_object
> acl localhost src 127.0.0.1/255.255.255.255
> <http://127.0.0.1/255.255.255.255>
>
> acl Safe_ports port 80
>
> http_access deny !Safe_ports
> http_access deny !serv1-path !serv2-path
>
> http_reply_access allow all
>
> http_access allow manager localhost
> http_access deny manager
>
> always_direct allow all
>
> url_rewrite_program /etc/squid/redirector.pl
> url_rewrite_children 5
>
> http_access deny all
>
> _/etc/squid/redirector.pl
> _
> #!/usr/bin/perl -p
> BEGIN { $|=1; }
> s%^http://squid.ext.com/serv1%http://server1.intranet.com
> <http://server2.intranet.com/>% && next;
> s%^http://squid.ext.com/serv2
> <http://squid.ext.com/serv1>%http://server2.intranet.com
> <http://server2.intranet.com/>% && next;_
>
> _

Received on Tue May 06 2008 - 07:39:07 MDT

This archive was generated by hypermail 2.2.0 : Tue May 13 2008 - 12:00:02 MDT