1. squid.conf
    2. #
    3. # Recommended minimum configuration:
    4. #
    5. # Example rule allowing access from your local networks.
    6. # Adapt to list your (internal) IP networks from where browsing
    7. # should be allowed
    8. acl localnet src 10.0.0.0/8 # RFC1918 possible internal network
    9. acl localnet src 0.0.0.0/0.0.0.0 # RFC1918 possible internal network
    10. #acl localnet src 172.16.0.0/12 # RFC1918 possible internal network
    11. #acl localnet src 192.168.0.0/16 # RFC1918 possible internal network
    12. #acl localnet src fc00::/7 # RFC 4193 local private network range
    13. #acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
    14. acl SSL_ports port 443
    15. acl Safe_ports port 80 # http
    16. acl Safe_ports port 21 # ftp
    17. acl Safe_ports port 443 # https
    18. acl Safe_ports port 70 # gopher
    19. acl Safe_ports port 210 # wais
    20. acl Safe_ports port 1025-65535 # unregistered ports
    21. acl Safe_ports port 280 # http-mgmt
    22. acl Safe_ports port 488 # gss-http
    23. acl Safe_ports port 591 # filemaker
    24. acl Safe_ports port 777 # multiling http
    25. acl CONNECT method CONNECT
    26. auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwd_squid
    27. auth_param basic children 20
    28. auth_param basic realm Light co Squid
    29. auth_param basic credentialsttl 5 hours         #认证的持续时间
    30. #acl ops-light proxy_auth REQUIRED
    31. acl auth_users proxy_auth ops-light
    32. auth_param basic casesensitive off
    33. visible_hostname Light-co.Squid.org
    34. #
    35. # Recommended minimum Access Permission configuration:
    36. #
    37. # Deny requests to certain unsafe ports
    38. http_access deny !Safe_ports
    39. # Deny CONNECT to other than secure SSL ports
    40. http_access deny CONNECT !SSL_ports
    41. # Only allow cachemgr access from localhost
    42. http_access allow localhost manager
    43. http_access deny manager
    44. # We strongly recommend the following be uncommented to protect innocent
    45. # web applications running on the proxy server who think the only
    46. # one who can access services on "localhost" is a local user
    47. #http_access deny to_localhost
    48. #
    49. # INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
    50. #
    51. # Example rule allowing access from your local networks.
    52. # Adapt localnet in the ACL section to list your (internal) IP networks
    53. # from where browsing should be allowed
    54. http_access allow localnet
    55. #http_access allow ops-light
    56. http_access allow auth_users
    57. http_access allow localhost
    58. # And finally deny all other access to this proxy
    59. http_access deny all
    60. # Squid normally listens to port 3128
    61. #http_port 3128
    62. http_port 9128
    63. # Uncomment and adjust the following to add a disk cache directory.
    64. #cache_dir ufs /var/spool/squid 100 16 256
    65. # Leave coredumps in the first cache dir
    66. coredump_dir /var/spool/squid
    67. #
    68. # Add any of your own refresh_pattern entries above these.
    69. #
    70. refresh_pattern ^ftp: 1440 20% 10080
    71. refresh_pattern ^gopher: 1440 0% 1440
    72. refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
    73. refresh_pattern . 0 20% 4320
    74. passwd_squid
    75. ops-light:$apr1$pYiupR/9$8RN8oJW17hANmqWf5CO6.1