PAC (Proxy Auto Configuration) file problem

Hi all, I have a problem related to a recently deployed PAC file.

We are behind an Squid proxy and we want to access a domain We are using a PAC file for auto configuring the proxy settings. Whe we set the browser to access DIRECT the webmail server can be accessed but when we set it like a non transparent proxy we cannot.

The webmail server has two NICs, one with private ip and one with public ip The second ip address is correctly resolved but we cannot get the login page.

All clients have ip 131.107.2.x, proxy ip is and port 3128.



I've attached the squid.conf file and the proxy.pac file

http_port 3128 transparent
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache deny QUERY
acl apache rep_header Server ^Apache
broken_vary_encoding allow apache

access_log /var/log/squid/access.log squid
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log

pid_filename /var/run/

log_fqdn on

hosts_file /etc/hosts

url_rewrite_program /usr/bin/squidGuard -c /etc/squid/squidGuard.conf
url_rewrite_children 2

auth_param ntlm program /usr/lib/squid/ntlm_auth -d unitanba.corp/ba-dc1
auth_param ntlm children 5
auth_param basic program /usr/lib/squid/ntlm_auth -d unitanba.corp/ba-dc1
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours 

refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320

acl all src
acl manager proto cache_object
acl localhost src
acl lan src
acl to_localhost dst
acl ntlm_users proxy_auth REQUIRED
acl SSL_ports port 443 # https
acl SSL_ports port 563 # snews
acl SSL_ports port 873 # rsync
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl Safe_ports port 631 # cups
acl Safe_ports port 873 # rsync
acl Safe_ports port 901 # SWAT
acl purge method PURGE

http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow ntlm_users
http_access allow localhost
http_access allow lan
http_access deny all
http_reply_access allow all

icp_access allow all
cache_effective_group proxy
visible_hostname Penelope
logfile_rotate 0
coredump_dir /var/spool/squid
#tcp_outgoing_tos 0x4

function FindProxyForURL(url, host){
	if (shExpMatch(url, "*")){
		return "DIRECT";

	if (isInNet(myIpAddress(), "", "")){
		return "PROXY";
		return "DIRECT";


Open in new window

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve JenningsIT ManagerCommented:
Why not . . .

function FindProxyForURL(url, host){
        if (isInNet(myIpAddress(), "", "")){
                return "PROXY";
                return "DIRECT";

Wish I could offer more.

Good luck,

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PanchuxAuthor Commented:
Steve, my original function looked just like that but since will resolve to and not as it should browser will use the proxy and proxy won't let you get the server.

Squid gives a tcp_denied 407 error. I might be able to solve it through Iptables but I don't know how. Other thought would be to change the DNS server (Windows 2003 Server DC) to route that domain to

The only thing I know is using the Squid as a transparent proxy it won't get the error and I would be able to browse the webmail page. Maybe it's just and ACL problem.

Any idea is welcome,

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.