squid.conf.template 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. acl localnet src 0.0.0.1-0.255.255.255 # RFC 1122 "this" network (LAN)
  2. acl localnet src 10.0.0.0/8 # RFC 1918 local private network (LAN)
  3. acl localnet src 100.64.0.0/10 # RFC 6598 shared address space (CGN)
  4. acl localnet src 169.254.0.0/16 # RFC 3927 link-local (directly plugged) machines
  5. acl localnet src 172.16.0.0/12 # RFC 1918 local private network (LAN)
  6. acl localnet src 192.168.0.0/16 # RFC 1918 local private network (LAN)
  7. acl localnet src fc00::/7 # RFC 4193 local private network range
  8. acl localnet src fe80::/10 # RFC 4291 link-local (directly plugged) machines
  9. acl SSL_ports port 443
  10. # acl SSL_ports port 1025-65535 # Enable the configuration to resolve this issue: https://github.com/langgenius/dify/issues/12792
  11. acl Safe_ports port 80 # http
  12. acl Safe_ports port 21 # ftp
  13. acl Safe_ports port 443 # https
  14. acl Safe_ports port 70 # gopher
  15. acl Safe_ports port 210 # wais
  16. acl Safe_ports port 1025-65535 # unregistered ports
  17. acl Safe_ports port 280 # http-mgmt
  18. acl Safe_ports port 488 # gss-http
  19. acl Safe_ports port 591 # filemaker
  20. acl Safe_ports port 777 # multiling http
  21. acl CONNECT method CONNECT
  22. acl allowed_domains dstdomain .marketplace.dify.ai
  23. http_access allow allowed_domains
  24. http_access deny !Safe_ports
  25. http_access deny CONNECT !SSL_ports
  26. http_access allow localhost manager
  27. http_access deny manager
  28. http_access allow localhost
  29. include /etc/squid/conf.d/*.conf
  30. http_access deny all
  31. ################################## Proxy Server ################################
  32. http_port ${HTTP_PORT}
  33. coredump_dir ${COREDUMP_DIR}
  34. refresh_pattern ^ftp: 1440 20% 10080
  35. refresh_pattern ^gopher: 1440 0% 1440
  36. refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
  37. refresh_pattern \/(Packages|Sources)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
  38. refresh_pattern \/Release(|\.gpg)$ 0 0% 0 refresh-ims
  39. refresh_pattern \/InRelease$ 0 0% 0 refresh-ims
  40. refresh_pattern \/(Translation-.*)(|\.bz2|\.gz|\.xz)$ 0 0% 0 refresh-ims
  41. refresh_pattern . 0 20% 4320
  42. # cache_dir ufs /var/spool/squid 100 16 256
  43. # upstream proxy, set to your own upstream proxy IP to avoid SSRF attacks
  44. # cache_peer 172.1.1.1 parent 3128 0 no-query no-digest no-netdb-exchange default
  45. ################################## Reverse Proxy To Sandbox ################################
  46. http_port ${REVERSE_PROXY_PORT} accel vhost
  47. cache_peer ${SANDBOX_HOST} parent ${SANDBOX_PORT} 0 no-query originserver
  48. acl src_all src all
  49. http_access allow src_all