Project

General

Profile

Segnalazione #88

Updated by Christopher R. Gabriel over 7 years ago

Per la nuova versione del server, facciamo deployment della autoconfigurazione del proxy.

Servono:

* nel template dhcpd, l'url del file di configurazione

<pre>
option local-pac-server code 252 = text;
option local-pac-server “http://URL_DEL_SERVER:80/wpad.dat”;
</pre>

* aggiungiamo un file in /etc/apache2/conf.d/ con le seguenti indicazioni:

<pre>
AddType application/x-ns-proxy-autoconfig .dat
Alias /proxy.pac /wpad.dat
</pre>

* nella document root, generiamo (tramite template) il file wpad.dat, questo il contenuto
<pre>
function FindProxyForURL(url, host) {
if (isInNet(myIpAddress(), "<RETE LAN>", "255.255.255.0"))
return "PROXY <IP SERVER SULLA LAN>:8080"; 192.168.10.1:8080";
if (isInNet(myIpAddress(), "<RETE CAPTIVE PORTAL>", "255.255.255.0"))
return "DIRECT";
}

</pre>

"<RETE LAN>" qualcosa tipo "192.168.10.0"

<IP SERVER SULLA LAN> tipo 192.168.10.1 (senza http:// come prefisso)


Back