Hi,
We have a squid reverse configuration, and we need to change backend webserver with a new webserver with new IP and port (80 --> 8000) .With port changing on new web server ( 80 --> 8000) , i find that i had to add new production web on url_rerite_program.
on part 1 --> current rewrite program configuration running today and correctly for testurl --> running fine
on part 2 --> configuration with change for testurl and productionurl -> OK for productionurl and KO for testurl
An idea if something is wrong on change ?
#!/usr/bin/perl
$INTERNALIP="15.40.40.40";
$PRODUCTIONURL="add.ptr.lu";
$TESTURL="test.add.ptr.lu";
$TESTPORT="8001";
# turn off write buffering
$| = 1;
while (<>) {
# get the URL from the request
chomp($url = "">
if ($url =~ m/($INTERNALIP|$TESTURL):$TESTPORT/)
{
# fix up the cname and port
$url =~ s^:$TESTPORT^^;
$url =~ s^$INTERNALIP^$TESTURL^;
# fix the protocol
$url =~ s^https://^http://^;
}
else
{
# fix up the name
$url =~ s^$INTERNALIP^$PRODUCTIONURL^;
# fix the protocol
$url =~ s^http://^https://^;
}
# return the fixed URL to squid
print "$url\n";
}
#!/usr/bin/perl
$INTERNALIP="15.40.40.40";
$PRODUCTIONURL="add.ptr.lu";
$TESTURL="test.add.ptr.lu";
$TESTPORT="8001";
$PRODPORT="8000";
# turn off write buffering
$| = 1;
while (<>) {
# get the URL from the request
chomp($url = ""
if ($url =~ m/($INTERNALIP|$TESTURL):$TESTPORT/)
{
# fix up the cname and port
$url =~ s^:$TESTPORT^^;
$url =~ s^$INTERNALIP^$TESTURL^;
# fix the protocol
$url =~ s^https://^http://^;
}
elsif ($url =~ m/($INTERNALIP|$PRODUCTIONURL):$PRODPORT/)
{
# fix up the cname and port
$url =~ s^:$PRODPORT^^;
$url =~ s^$INTERNALIP^$PRODURL^;
# fix the protocol
$url =~ s^https://^http://^;
}
else
{
# fix up the name
$url =~ s^$INTERNALIP^$PRODUCTIONURL^;
# fix the protocol
$url =~ s^http://^https://^;
}
# return the fixed URL to squid
print "$url\n";
}
_______________________________________________ squid-users mailing list squid-users@xxxxxxxxxxxxxxxxxxxxx http://lists.squid-cache.org/listinfo/squid-users