Advertisement
ujiajah1

squid.conf / squid-4.0.4

Jan 26th, 2016
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.72 KB | None | 0 0
  1. # SQUID CONFIGURATION SQUID VERSION-3.5.xx
  2. # HTTP | HTTPS SQUID PROXY SERVER
  3.  
  4. acl all src
  5. acl SSL_ports port 443
  6. acl SSL_ports port 5353
  7. acl Safe_ports port 21
  8. acl Safe_ports port 22
  9. acl Safe_ports port 53
  10. acl Safe_ports port 70
  11. acl Safe_ports port 80
  12. acl Safe_ports port 210
  13. acl Safe_ports port 280
  14. acl Safe_ports port 1025-65535
  15. acl Safe_ports port 443
  16. acl Safe_ports port 488
  17. acl Safe_ports port 591
  18. acl Safe_ports port 777
  19. acl Safe_ports port 5353
  20. acl Safe_ports port 18901-18909
  21. acl Safe_ports port 1818
  22. acl Safe_ports port 39190
  23. acl Safe_ports port 40000-40010
  24. acl Safe_ports port 7777
  25. acl Safe_ports port 19101
  26. acl Safe_ports port 27780
  27. acl Safe_ports port 29000
  28. acl Safe_ports port 22100
  29. acl Safe_ports port 5121
  30. acl Safe_ports port 6000-6152
  31. acl Safe_ports port 2001
  32. acl Safe_ports port 9601-9602
  33. acl Safe_ports port 8085
  34. acl Safe_ports port 11011-11041
  35. acl Safe_ports port 13413
  36. acl Safe_ports port 19000
  37. acl Safe_ports port 5105
  38. acl Safe_ports port 10009
  39. acl Safe_ports port 12060-12070
  40. acl Safe_ports port 6000-6001
  41. acl Safe_ports port 29200
  42. acl Safe_ports port 10402
  43. acl Safe_ports port 9600
  44. acl Safe_ports port 15002
  45. acl Safe_ports port 16402-16502
  46. acl Safe_ports port 5126
  47. acl Safe_ports port 3010
  48. acl Safe_ports port 11031
  49. acl Safe_ports port 11440-11460
  50. acl Safe_ports port 11100-11125
  51. acl Safe_ports port 4300
  52. acl Safe_ports port 12011
  53. acl Safe_ports port 12110
  54. acl Safe_ports port 15001
  55. acl Safe_ports port 15002
  56. acl Safe_ports port 7341
  57. acl Safe_ports port 7451
  58. acl Safe_ports port 7808
  59. acl Safe_ports port 30000
  60. acl Safe_ports port 9001
  61. acl Safe_ports port 9030
  62. acl Safe_ports port 953
  63. acl Safe_ports port 42051-42052
  64. acl Safe_ports port 36567
  65. acl Safe_ports port 8001
  66. acl Safe_ports port 14000-14050
  67. acl Safe_ports port 27019
  68. acl Safe_ports port 28901-28920
  69. acl Safe_ports port 7201-7208
  70. acl Safe_ports port 17001-17002
  71. acl Safe_ports port 14300-14440
  72. acl Safe_ports port 15100-15150
  73. acl Safe_ports port 7770-7790
  74. acl Safe_ports port 16320-16340
  75. acl Safe_ports port 9000-9160
  76. acl Safe_ports port 7200
  77. acl Safe_ports port 7400
  78. acl Safe_ports port 7106
  79. acl Safe_ports port 7999
  80. acl Safe_ports port 47611
  81. acl Safe_ports port 36567
  82. acl Safe_ports port 10087
  83. acl Safe_ports port 27000-27050
  84. acl Safe_ports port 27014-27050
  85. acl Safe_ports port 4380
  86. acl Safe_ports port 3478
  87. acl Safe_ports port 4379
  88. acl Safe_ports port 8890
  89. acl Safe_ports port 9339
  90. acl Safe_ports port 8890
  91. acl Safe_ports port 7200-7210
  92. acl Safe_ports port 7450-7460
  93. acl Safe_ports port 8000
  94. acl Safe_ports port 64990-65010
  95. acl CONNECT method CONNECT
  96. # =======================================================================
  97. # Lock_resol 240-360
  98. # =======================================================================
  99. acl youtube_240 dstdomain .youtube.com
  100. request_header_access Accept-Encoding deny youtube_240
  101. loadable_modules /usr/local/lib/DSI_ecap_youtube.so
  102. ecap_enable on
  103. ecap_service ecapModifier respmod_precache \
  104. uri=ecap://dokter-squid.com/ecap yt_quality=small
  105. adaptation_access ecapModifier allow youtube_240
  106. adaptation_access ecapModifier deny all
  107.  
  108. # =========================================================================
  109. # ACCESS RULES
  110. http_access deny !Safe_ports
  111. http_access deny CONNECT !SSL_ports
  112. http_access allow all
  113. http_reply_access allow all
  114.  
  115. # LISTENING PORT SQUID
  116. https_port 3127 tproxy ssl-bump generate-host-certificates=on dynamic_cert_mem_cache_size=4MB cert=/etc/squid/ssl_certs/squid.crt key=/etc/squid/ssl_certs/squid.key cipher=ECDHE-RSA-RC4-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES128-SHA:DHE-RSA-CAMELLIA128-SHA:AES128-SHA:RC4-SHA:HIGH:!aNULL:!MD5:!ADH
  117. http_port 3128
  118. http_port 3129 tproxy
  119.  
  120. # CONNECTION HANDLING
  121. qos_flows local-hit=0x30
  122. collapsed_forwarding on
  123. balance_on_multiple_ip on
  124. detect_broken_pconn on
  125. client_persistent_connections off
  126. server_persistent_connections on
  127.  
  128. # DNS OPTIONS
  129. #dns_packet_max 4096
  130. #dns_defnames on
  131. #dns_v4_first on
  132. dns_nameservers 172.16.0.1 192.168.1.254 8.8.8.8 8.8.4.4
  133. connect_retries 2
  134. negative_dns_ttl 1 second
  135. range_offset_limit 0
  136. quick_abort_min 0
  137. quick_abort_max 0
  138. quick_abort_pct 80
  139. ipcache_low 98
  140. ipcache_high 99
  141. ipcache_size 4096
  142. fqdncache_size 2048
  143. pipeline_prefetch 0
  144.  
  145. # MISCELEANOUS
  146. memory_pools off
  147. reload_into_ims on
  148. max_filedescriptors 65536
  149.  
  150. # CACHE MANAGEMENT
  151. cache_mem 512 MB
  152. maximum_object_size_in_memory 128 KB
  153. memory_replacement_policy heap GDSF
  154. cache_effective_group proxy
  155. cache_effective_user proxy
  156. cache_dir aufs /cache/cache 50000 16 256
  157. coredump_dir /cache/cache
  158. cache_mgr proxy-server
  159. visible_hostname proxy-server
  160. minimum_object_size 0 KB
  161. maximum_object_size 1 GB
  162. read_ahead_gap 64 KB
  163. cache_replacement_policy heap LFUDA
  164. store_dir_select_algorithm least-load
  165. cache_swap_low 90
  166. cache_swap_high 95
  167.  
  168. # LOG FILE OPTIONS
  169. acl log method CONNECT
  170. logfile_daemon /usr/lib/squid/log_file_daemon
  171. access_log daemon:/var/log/squid/access.log !CONNECT
  172. cache_log /var/log/squid/cache.log
  173. cache_store_log /var/log/squid/store.log
  174. debug_options ALL,1 22,3
  175. cache_store_log none
  176. logfile_rotate 3
  177. pid_filename /var/run/squid.pid
  178.  
  179. # FILTERING HTTPS
  180. acl 1 dstdomain .fbcdn.net .akamaihd.net .fbsbx.com
  181. #acl 2a dstdomain .mahadana.com .mql4.com .metaquotes.net
  182. acl 2 url_regex -i ^https?:\/\/attachment\.fbsbx\.com\/.*\?(id=[0-9]*).*
  183. acl 2 url_regex -i \.fbsbx\.com\/.*\/(.*\.(unity3d|pak|zip|exe|dll|jpg|png|gif|swf)/)$
  184. acl 2 url_regex -i ^https?:\/\/.*\.ytimg\.com(.*\.(webp|jpg|gif))
  185. acl 2 url_regex -i ^https?:\/\/([^\.]*)\.yimg\.com\/(.*)
  186. acl 2 url_regex -i ^https?:\/\/.*\.gstatic\.com\/images\?q=tbn\:(.*)
  187. acl 2 url_regex -i ^https?:\/\/.*\.reverbnation\.com\/.*\/(ec_stream_song|download_song_direct|stream_song)\/([0-9]*).*
  188. acl 2 url_regex -i ^https?:\/\/([a-z0-9.]*)(\.doubleclick\.net|\.quantserve\.com|.exoclick\.com|interclick.\com|\.googlesyndication\.com|\.auditude\.com|.visiblemeasures\.com|yieldmanager|cpxinteractive)(.*)
  189. acl 2 url_regex -i ^https?:\/\/(.*?)\/(ads)\?(.*?)
  190. acl 2 url_regex -i ^https?:\/\/.*steampowered\.com\/.*\/([0-9]+\/(.*))
  191. acl 3 url_regex -i ^https?:\/\/(.*?)\/speedtest\/.*\.(jpg|txt|png|gif|swf)\?.*
  192. acl 3 url_regex -i speedtest\/.*\.(jpg|txt|png|gif|swf)\?.*
  193. acl 4 url_regex -i reverbnation.*audio_player.*ec_stream_song.*$
  194. acl 5 url_regex -i utm.gif.*
  195. acl 6 url_regex -i c.android.clients.google.com.market.GetBinary.GetBinary.*
  196. acl 7 url_regex -i youtube.*(ptracking|stream_204|player_204|gen_204).*$
  197. acl 7 url_regex -i \.c\.(youtube|google)\.com\/(get_video|videoplayback|videoplay).*$
  198. acl 7 url_regex -i (youtube|google).*\/videoplayback\?.*
  199. acl 8 http_status 302
  200.  
  201. acl store_url url_regex -i (youtube|googlevideo|docs.google|video.google).*videoplayback\?.*
  202. acl loop_302 http_status 302
  203. acl loop_mime rep_mime_type text/html
  204. acl loop_mime rep_mime_type text/plain
  205. acl getmethod method GET
  206.  
  207. store_miss deny store_url loop_302
  208. store_miss deny store_url loop_mime
  209. send_hit deny store_url loop_302
  210. send_hit deny store_url loop_mime
  211.  
  212. ssl_bump splice localhost
  213. acl 9 at_step SslBump1
  214. acl 10 at_step SslBump2
  215. acl 11 at_step SslBump3
  216. ssl_bump peek 9 all
  217. ssl_bump stare 10 all
  218. ssl_bump splice 11 all
  219.  
  220. sslcrtd_program /usr/lib/squid/ssl_crtd -s /etc/squid/ssl_db -M 4MB
  221. sslcrtd_children 16 startup=1 idle=1
  222. sslproxy_cert_error allow all
  223. always_direct allow all
  224. ssl_unclean_shutdown on
  225.  
  226. # STORE ID
  227. store_id_program /usr/bin/perl /etc/squid/store-id.pl
  228. store_id_children 10 startup=5 idle=2 concurrency=10
  229. store_id_access allow 1
  230. store_id_access allow 2
  231. store_id_access allow 3
  232. store_id_access allow 4
  233. store_id_access allow 5
  234. store_id_access allow 6
  235. store_id_access allow 7
  236. store_miss deny 7 8
  237. send_hit deny 7 8
  238. store_id_access deny all
  239.  
  240. # TUNNING CACHE
  241. max_stale 1 years
  242. vary_ignore_expire on
  243. shutdown_lifetime 10 seconds
  244.  
  245. include /etc/squid/refresh.conf
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement