squid設定例

技術
# Recommended minimum configuration: 
#

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
#acl localnet src 0.0.0.1-0.255.255.255
#acl localnet src 10.0.0.0/8
#acl localnet src 100.64.0.0/10
#acl localnet src 169.254.0.0/16
#acl localnet src 172.16.0.0/12
#acl localnet src 192.168.0.0/16
#acl localnet src fc00::/7      
#acl localnet src fe80::/10      

acl SSL_ports port XXXX
acl Safe_ports port XXXX
acl Safe_ports port XXXX
acl Safe_ports port XXXX
#acl Safe_ports port 70
#acl Safe_ports port 210
#acl Safe_ports port 1025-65535
#acl Safe_ports port 280
#acl Safe_ports port 488
#acl Safe_ports port 591
#acl Safe_ports port 777
acl CONNECT method CONNECT
acl unyou src XXX.XXX.XXX.XXX/24
acl unyou src XXX.XXX.XXX.XXX/24
acl unyou src XXX.XXX.XXX.XXX/24
acl unyou src XXX.XXX.XXX.XXX/24


#
# Recommended minimum Access Permission configuration:
#

# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
#http_access allow localnet
http_access allow localhost
http_access allow unyou

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 0.0.0.0:XXXX

# Uncomment and adjust the following to add a disk cache directory.
cache_dir ufs /var/spool/squid 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/spool/squid

#Access log
access_log /var/log/squid/access.log common
logformat squid %tl %6tr %>a %Ss/%3>Hs %<st %rm %ru %un %Sh/%<A %mt

#PURGE
acl PURGE method PURGE
http_access allow PURGE localhost
http_access deny PURGE

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp:
refresh_pattern ^gopher:
refresh_pattern -i (/cgi-bin/|\?) 0
refresh_pattern .

#Proxy
#cache_peer XXX.XXX.XXX.XXX parent XXXX 0 no-query
#never_direct allow all

#Error message
error_directory /usr/share/squid/errors/ja

#Security
forwarded_for off

#cache deny
acl NOCACHE src all
cache deny NOCACHE

コメント

タイトルとURLをコピーしました