squid_ui/config/squid.conf
2025-06-24 21:40:57 +08:00

29 lines
855 B
SquidConf
Executable File

http_port 3128
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/squid_passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
acl auth_users proxy_auth REQUIRED
http_access allow auth_users
http_access deny all
# 缓存配置
cache_dir ufs /var/cache/squid 100 16 256
cache_mem 256 MB
maximum_object_size 50 MB
# 日志与PID
pid_filename /tmp/squid.pid
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log
# 日志轮转设置
logfile_rotate 10
# 自定义日志格式(年月日时分秒)
logformat custom_format %{%Y/%m/%d %H:%M:%S}tl.%03tu %6tr %>a %Ss/%03Hs %<st %rm %ru %[un] %Sh/%<A %mt
access_log /var/log/squid/access.log custom_format
# 强制使用英语错误页面(可选)
error_directory /usr/share/squid/errors/en