ee /usr/local/www/nginx/proxy.pac function FindProxyForURL(url, host) { // our local URLs from the domains below mydomain.com don't need a proxy if (shExpMatch(url,"*.BeastyJoe4k.ga/*")) {return "DIRECT";} if (shExpMatch(url, "*.BeastyJoe4k.ga:*/*")) {return "DIRECT";} // client computers within this network are accessed through // port 3128 on proxy1.mydomain.local: if (isInNet(myIpAddress(), "192.168.0.0", "127.0.0.1", "255.255.255.0")) {return "PROXY 20.2.2.1:3128"; } // All other requsests go through port 3128 of proxy2.mydomain.local. // should that fail to respond, go directly to the www: return "PROXY 20.2.2.1:3128; DIRECT"; } ln -s /usr/local/www/nginx/proxy.pac /usr/local/www/nginx/wpad.dat ln -s /usr/local/www/nginx/proxy.pac /usr/local/www/nginx/wpad.da ee ln -s /usr/local/www/nginx/nginx-wpad.conf i put /usr/local/ect/nginx/nginx-wpad.conf worker_processes 1; events { worker_connections 1024; } http { inculde wpad-mine.types; default_type application/octet-steam; sendfile on; keepalive_timeout 65; server { listen 80; server_name wpad; location / { root /usr/local/www/nginx; index index.html index.htm; } } } ee usr/local/etc/nginxwpad-mime.types types { text/html html htm shtml; text/css ccs; image/jpeg jpeg jpg; text/plain txt; application/x-ns-proxy-autoconfig pac; application/x-ns-proxy-autoconfig dat; application/x-ns-proxy-autoconfig da; } /usr/local/sbin/nginx -c /usr/local/ect/nginx/nginx-wpad.conf #!/bin/sh /bin/ps ax | /usr/bin/grep /usr/local/ect/nginx/nginx-wpad.conf | /usr/bin/grep -v grep if [ $? -eg 0 ];then /bin/echo ok else /usr/local/sbin/nginx -c /usr/local/ect/nginx/nginx-wpad.conf fi http://wpad.BeastyJoe4k.ga/proxy.pac