「Squid」:修訂間差異
跳至導覽
跳至搜尋
第10行: | 第10行: | ||
== 範例 == | == 範例 == | ||
Forward Proxy的設法: | |||
<syntaxhighlight lang="squid"> | |||
# | |||
access_log none | |||
cache deny all | |||
cache_dir null /tmp | |||
cache_log /dev/null | |||
cache_mem 8 MB | |||
forwarded_for off | |||
http_access allow all | |||
http_port 3128 | |||
</syntaxhighlight> | |||
Reverse Proxy的設法: | Reverse Proxy的設法: | ||
< | |||
<syntaxhighlight lang="squid"> | |||
# | |||
acl all src 0.0.0.0/0 | acl all src 0.0.0.0/0 | ||
acl PURGE method PURGE | acl PURGE method PURGE | ||
第52行: | 第68行: | ||
minimum_object_size 1 KB # FIXME | minimum_object_size 1 KB # FIXME | ||
refresh_pattern . 60 90% 604800 override-expire ignore-reload ignore-no-cache ignore-no-store | refresh_pattern . 60 90% 604800 override-expire ignore-reload ignore-no-cache ignore-no-store | ||
store_avg_object_size 10 MB # FIXME</ | store_avg_object_size 10 MB # FIXME | ||
</syntaxhighlight> | |||
== 外部連結 == | == 外部連結 == |
於 2020年4月9日 (四) 03:55 的修訂
Squid是一套Proxy軟體。
安裝
在Ubuntu 18.04上可以直接透過系統的套件裝Squid 3.5版:
sudo apt install -y squid
範例
Forward Proxy的設法:
#
access_log none
cache deny all
cache_dir null /tmp
cache_log /dev/null
cache_mem 8 MB
forwarded_for off
http_access allow all
http_port 3128
Reverse Proxy的設法:
#
acl all src 0.0.0.0/0
acl PURGE method PURGE
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl localnet src 10.0.0.0/255.0.0.0
#
http_access allow manager localhost
http_access deny manager
http_access allow PURGE localhost
http_access allow PURGE localnet
http_access deny PURGE
http_access deny all
#
access_log daemon:/home/logs/squid/access.log squid
cache_dir aufs /big/cache 358400 32 256 # FIXME
cache_effective_group nogroup
cache_effective_user nobody
cache_log /home/logs/squid/cache.log
cache_mem 1024 MB
cache_peer 10.1.2.3 parent 80 0 no-query round-robin originserver monitorurl=http://host/robots.txt # FIXME
cache_peer 10.1.2.4 parent 80 0 no-query round-robin originserver monitorurl=http://host/robots.txt # FIXME
cache_replacement_policy heap LFUDA # FIXME
cache_store_log daemon:/home/logs/squid/store.log
cache_swap_high 95
cache_swap_low 80
client_db off
coredump_dir /home/logs
follow_x_forwarded_for allow localnet
forwarded_for on
half_closed_clients off
http_port 80 accel defaultsite=default.domain.tld # FIXME
logfile_daemon /usr/local/squid/libexec/logfile-daemon
logfile_rotate 3
maximum_object_size 307200 KB # FIXME
maximum_object_size_in_memory 102400 KB # FIXME
memory_pools_limit 1331 MB # FIXME
minimum_expiry_time 604800 seconds
minimum_object_size 1 KB # FIXME
refresh_pattern . 60 90% 604800 override-expire ignore-reload ignore-no-cache ignore-no-store
store_avg_object_size 10 MB # FIXME
外部連結
- 官方網站 (英文)