Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Squid.conf untuk Youtube Caching
- # Web : http://www.tuts.web.id
- http_port 8080 transparent
- server_http11 on
- icp_port 0
- # Ukuran cache saya set 5 GB dan folder cache di /cache, silahkan ganti sesuai kebutuhan anda
- store_dir_select_algorithm round-robin
- cache_dir aufs /cache 5000 16 256
- cache_replacement_policy heap LFUDA
- memory_replacement_policy heap LFUDA
- # Format log squid
- emulate_httpd_log on
- logformat squid %tl %6tr %>a %Ss/%03Hs %<st %rm %ru %un %Sh/%<A %mt
- log_fqdn off
- # Berapa hari file log akan tersimpan? saya set disini 2 hari.
- # Anda bisa melakukan rotasi file log secara berkala dengan cron. Contoh:
- # 0 0 * * * /usr/local/squid/bin/squid -k rotate
- logfile_rotate 2
- debug_options ALL,1
- cache_access_log /var/log/squid/access.log
- cache_log /var/log/squid/cache.log
- cache_store_log /var/log/squid/store.log
- #192.168.0.155 adalah Unbound DNS Server milik saya, berfungsi agar mempercepat query DNS
- #Jika anda tidak memiliki local dns server, isi dengan DNS server seperti Google DNS, yakni 8.8.8.8
- dns_nameservers 192.168.0.155
- #Access Control List
- acl all src 0.0.0.0/0.0.0.0
- acl manager proto cache_object
- acl localhost src 127.0.0.1/255.255.255.255
- acl to_localhost dst 127.0.0.0/8
- acl SSL_ports port 443 563 # https, snews
- acl SSL_ports port 873 # rsync
- acl Safe_ports port 80 # http
- acl Safe_ports port 21 # ftp
- acl Safe_ports port 443 563 # https, snews
- acl Safe_ports port 70 # gopher
- acl Safe_ports port 210 # wais
- acl Safe_ports port 1025-65535 # unregistered ports
- acl Safe_ports port 280 # http-mgmt
- acl Safe_ports port 488 # gss-http
- acl Safe_ports port 591 # filemaker
- acl Safe_ports port 777 # multiling http
- acl Safe_ports port 631 # cups
- acl Safe_ports port 873 # rsync
- acl Safe_ports port 901 # SWAT
- acl purge method PURGE
- acl CONNECT method CONNECT
- http_access allow manager localhost
- http_access deny manager
- http_access allow purge localhost
- http_access deny purge
- http_access deny !Safe_ports
- http_access deny CONNECT !SSL_ports
- http_access allow localhost
- http_access allow all
- http_reply_access allow all
- icp_access allow all
- cache_effective_user proxy
- cache_effective_group proxy
- cache_mgr anda@email.com
- visible_hostname proxy.tuts.web.id
- unique_hostname anda@email.com
- cache_mem 8 MB
- minimum_object_size 0 bytes
- maximum_object_size 100 MB
- maximum_object_size_in_memory 128 KB
- refresh_pattern ^ftp: 1440 20% 10080
- refresh_pattern ^gopher: 1440 0% 1440
- refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
- refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880
- refresh_pattern . 0 50% 4320
- acl apache rep_header Server ^Apache
- broken_vary_encoding allow apache
- # Rules untuk caching video YouTube
- url_rewrite_program /etc/nginx/nginx.rb
- url_rewrite_host_header off
- acl youtube_videos url_regex -i ^http://[^/]+\.youtube\.com/videoplayback\?
- acl range_request req_header Range .
- acl begin_param url_regex -i [?&]begin=
- acl id_param url_regex -i [?&]id=
- acl itag_param url_regex -i [?&]itag=
- acl sver3_param url_regex -i [?&]sver=3
- cache_peer 127.0.0.1 parent 8081 0 proxy-only no-query connect-timeout=10
- cache_peer_access 127.0.0.1 allow youtube_videos id_param itag_param sver3_param !begin_param !range_request
- cache_peer_access 127.0.0.1 deny all
- #end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement