SQUID 2.6 location_rewrite_program problem
Good day I'm using squid+iptables to give access to a web server located in my Intranet the squid server has two interfaces one to connect to the dmz 192.168.101.30 and one to connect to the intranet 10.74.4.203. When I try to reach a web page located in the server and this web page got redirected (302. Moved Temporarily) I can get throug the server because this message answer with the IP for the server inside the intranet. I used Squidguard to rewrite the location message inside the http response but i can't make this work. I have readed and look for information but i can't find any.
Can any one please give a hand on this. This is my squid.conf
http_port 3128 defaultsite=10.74.4.201
cache_peer 10.74.4.201 parent 80 0 no-query originserver name=RBT_WEB
#cache_peer 10.74.4.201 parent 80 0 no-query proxy-only forceddomain=10.74.4.203 name=RBT_WEB
acl port80 port 80
http_access allow port80
cache_peer_access RBT_WEB allow port80
location_rewrite_program /usr/local/bin/squidGuard -c /usr/local/squidGuard/squidGuard.conf
And this is the squidGuard file
#
# CONFIG FILE FOR SQUIDGUARD
#
dbhome /usr/local/squidGuard/db
logdir /usr/local/squidGuard/log
# REWRITE RULES:
#
rewrite viva_corp {
s@^//10.74.4.201/@//192.168.101.30/\1@i
s@^http://10.74.4.201/(.*)$@http://192.168.101.30/\1@i
s@^(.*)10.74.4.201(.*)$@\1192.168.101.30\2@i
log viva_corp.log
}
#
# SOURCE ADDRESSES:
#
src viva-corp-net {
ip 10.20.0.0/16
}
src viva-dmz {
ip 192.168.101.0/24
ip 10.74.4.0/24
}
#
# DESTINATION CLASSES:
#
acl {
viva-corp-net {
pass any
rewrite viva_corp
}
viva-dmz {
pass any
rewrite viva_corp
}
default {
pass none
rewrite viva_corp
}
}
I'm using iptables with masquerading and DNAT. Any help will be apreciated.
Thank you very much
|