[squid-users] [EXTERNAL] Access to internal domains using Squid

Joey Officer JOfficer at istreamfs.com
Thu Feb 9 19:22:14 UTC 2023


Was thinking I should give an example of a proxy auto configuration script:

pac.conf : 
/* proxy auto configuration file sample */

function FindProxyForURL(url, host)
{
	var proxy_no = "DIRECT";
	var proxy_yes = "PROXY proxy.domain.com:3128";

/* Generally matches internal hosts.  Ex: "https://hostname/" */
	if (isPlainHostName(host)) return proxy_no;

/* Matches domain to not proxy */
	if (dnsDomainIs(host, "noproxydomain.com")) return proxy_no;

/* Local networks - allows skipping proxy for LAN servers */
	if (isInNet(host, "192.168.0.0", "255.255.0.0")) return proxy_no;            

	return proxy_yes;
}

You'd host that config on some internal web server and have your browsers configured to load the configuration script.  Then the client evaluates the host/IP and makes the decision to route via the proxy (proxy_yes) or not (proxy_no).  Keep in mind the configuration is top down and the first match will apply.  There are likely better and more complete examples online.  Just wanted to expand on my previous reply.

Joey

-----Original Message-----
From: squid-users <squid-users-bounces at lists.squid-cache.org> On Behalf Of Roberto Carna
Sent: Wednesday, February 8, 2023 9:51 AM
To: squid-users at lists.squid-cache.org
Subject: [EXTERNAL][squid-users] Access to internal domains using Squid

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Dear all, I have a Squid server in non-transparent mode.

All my hosts go to Internet sites using this proxy in the correct way.

But now I need the following:

When my hosts want to go to the internal URL https://www.example.com, this request reaches Squid and it tells them to go to the internal IP from our backend web server .....Maybe a certain type of redirect.

Is this possible?

Special thanks!!!
_______________________________________________
squid-users mailing list
squid-users at lists.squid-cache.org
http://lists.squid-cache.org/listinfo/squid-users


More information about the squid-users mailing list