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

From: Sylvain Beaux <sylvain.beaux@dont-contact.us>
Date: Mon, 05 May 2008 22:16:05 +0200

Thank you for the explanations. I made squid working with url rewriting.

But i've got an other problem, each web server use cookie 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

acl manager proto cache_object
acl localhost src 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%&& next;
s%^http://squid.ext.com/serv2%http://server2.intranet.com%&& next;

regards
Sylvain
Received on Mon May 05 2008 - 20:13:30 MDT

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