---------------------------------------------------
squid.conf
---------------------------------------------------
http_port 8080
hierarchy_stoplist cgi-bin ? .pl .cgi .php .php3 .php4 .shtml
acl QUERY urlpath_regex cgi-bin \? .pl .cgi .php .php3 .php4 .shtml
no_cache deny QUERY
cache_mem 256 MB
cache_swap_low 90
cache_swap_high 95
maximum_object_size 4096 KB
minimum_object_size 0 KB
maximum_object_size_in_memory 8 KB
cache_dir ufs /cache1 24 256
cache_dir ufs /cache2 24 256
cache_access_log none
cache_log none
cache_store_log none
pid_filename none
refresh_pattern -i .(class|pdf|rtf|doc|wp|wp5|ps|prn)$ 1440 90% 1440 override-lastmod override-expire reload-into-ims ignore-reload
refresh_pattern -i .(mov|avi|mpg|wav|au|mid|mp3)$ 1440 100% 1440 override-lastmod override-expire reload-into-ims ignore-reload
refresh_pattern -i .(zip|gz|arj|lha|lzh|rar|tgz|tar|Z)$ 1440 80% 1440 override-lastmod override-expire reload-into-ims ignore-reload
refresh_pattern -i .(jpg|gif|jpeg|png|css|js)$ 1440 19000% 1440 override-lastmod override-expire reload-into-ims ignore-reload
refresh_pattern -i .(bmp|tif|tiff|xbm)$ 1440 17000% 1440 override-lastmod override-expire reload-into-ims ignore-reload
refresh_pattern -i .(png|swf)$ 1440 18000% 1440 override-lastmod override-expire reload-into-ims ignore-reload
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
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 localnet src 192.168.0.0/255.255.255.0
acl SSL_ports port 443 563
acl Safe_ports port 21 70 80 210 280 443 563 488 591 777 1025-65535
acl CONNECT method CONNECT
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access allow localnet
http_access allow all
cache_mgr Administrator
cache_effective_user squid
cache_effective_group squid
visible_hostname Siamcafe@net
reload_into_ims on
ie_refresh on
emulate_httpd_log on
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
query_icmp off
buffered_logs on
we made one for ourselves, it's not based on anything. right now it works really well. remember that we are not trying to make another squid - RouterOS is for routers, so we made something that suits our needs.What are you using if not Squid? Also, Squid is open source... it would seem to make a lot more sense to use a working, compliant cache than to write one from the ground up and encounter all the intricacies of the HTTP specification. No offense but I really don't think MT will be able to come up with a caching HTTP proxy that is anywhere near the level of performance and compliance as Squid, not without blatantly disregarding the HTTP specifications regarding caching at least...
Speaking of which, you should never use refresh_patterns like maroon posted... overriding the origin server is not something to be taken lightly and WILL cause problems for your users when they are unable to receive updated content. Only in the most dire of circumstances (dialup backhaul for your 100 customers) should you be overriding the cache policies of origin servers.
but we should fine-tune the squid to get the best performance by using the refresh-patterns and so, otherwise SQUID never mentioned/published such things for improving things...RICH Said:
Speaking of which, you should never use refresh_patterns like maroon posted... overriding the origin server is not something to be taken lightly and WILL cause problems for your users when they are unable to receive updated content. Only in the most dire of circumstances (dialup backhaul for your 100 customers) should you be overriding the cache policies of origin servers.
/system script add name=backup-link source={
/ip route set [/ip route find comment=primary] disabled=yes
/ip route set [/ip route find comment=backup] disabled=no
/tool netwatch set [/tool netwatch find comment=ping-primary-google] disabled=yes
/tool netwatch set [/tool netwatch find comment=ping-primary-gtw] disabled=no
}
/tool netwatch add host=66.249.93.104 interval=5s down-script=backup-link coment=ping-primary-google
/tool netwatch add host=192.168.1.1 interval=5s up-script=primary-link down-script= comment=ping-primary-gtw
/system script add name=primary-link source={
/ip route set [/ip route find comment=primary] disabled=no
/ip route set [/ip route find comment=backup] disabled=yes
/tool netwatch set [/tool netwatch find comment=ping-primary-google] disabled=no
/tool netwatch set [/tool netwatch find comment=ping-primary-gtw] disabled=yes
}
No, you shouldn't... those options are only exposed if you really need to save every byte of bandwidth (dialup, satellite, etc). In your squid.conf you are overriding the origin servers cache policies. Things like CAPTCHA images and dynamic signatures often rely on a dynamic .jpg or other image file which will likely break when running under your config since you force it to be cached when it should be changing every request. If you read the Squid documentation it says that using such features violates the HTTP protocol and makes your cache non-compliant. I would rather have a working compliant cache than have my customers unable to access content properly due to the cache.but we should fine-tune the squid to get the best performance by using the refresh-patterns and so, otherwise SQUID never mentioned/published such things for improving things...
and i got the same problem.MT NAT :
;;; Squid Proxy
chain=dstnat in-interface=bridge1 protocol=tcp dst-port=80 action=dst-nat
to-addresses=192.168.1.182 to-ports=3128
192.168.1.182 is fedora box IP ..
the squid port is 3128
and :
acl all src 192.168.1.0/255.255.255.0
http_access allow all
so , whts the problem ??
I am NAT'ing to an outside proxy.i still wonder , just for knowledge , why we can't redirect the traffic by NAT to the squid proxy ? what's wrong with it ? theoritaclly it has to be done by NAT .. but it doesn't ..
Where you see {my subnets here} you need to add the subnets you want allowed access.#Recommended minimum configuration:
#
# Only allow cachemgr access from localhost
http_access allow manager localhost
http_access deny manager
# Deny requests to unknown ports
http_access deny !Safe_ports
# Deny CONNECT to other than SSL ports
http_access deny CONNECT !SSL_ports
#
# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
acl our_networks src 10.0.0.0/16 {my subnets here}
http_access allow our_networks
# Example rule allowing access from your local networks. Adapt
# to list your (internal) IP networks from where browsing should
# be allowed
#acl our_networks src 192.168.1.0/24 192.168.2.0/24
#http_access allow our_networks
# And finally deny all other access to this proxy
http_access deny all
reload_into_ims on
Why would that cause a problem? It simply modifys a forced refresh into a "if modified since". Downloads header and checks to see if whats in the cache is the same as on server and if so serves the cached copy.Don't you have proble with this ?Code: Select allreload_into_ims on
http_port 8080
icp_port 0
cache_mem 300 MB
maximum_object_size 160386 KB
maximum_object_size_in_memory 3200 KB
memory_replacement_policy lru
cache_dir aufs /usr/local/squid/cache 30000 32 512
reference_age 1 month
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 SSL_ports port 443 563
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 CONNECT method CONNECT
acl subnet-1 src <network-address>/<netmask>
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow subnet-1
http_access deny all
icp_access allow all
cache_mgr you@net.net
cache_effective_user nobody
cache_effective_group nobody
visible_hostname proxy.net
httpd_accel_host virtual
httpd_accel_port 80
httpd_accel_with_proxy on
httpd_accel_uses_host_header on
dns_testnames netscape.com internic.net nlanr.net microsoft.com
logfile_rotate 10
append_domain .net.net
forwarded_for off
ie_refresh on
chain=dstnat in-interface=local protocol=tcp dst-port=80 src-address-list=filtered action=dst-nat to-addresses=192.168.1.5 to-ports=8080
Since the documentation for the webproxy package only mentions the HTTP and FTP protocols (though whether it really handles the latter is unknown to me), what would make you think it's going to handle POP3 and SMTP?I will try posting in this thread as I have been unable to get reply in the past.
Web-Proxy when enabled 2.9.43 and above or the 3.0 beta, and installed on a gateway router (PC),
does not allow POP3 and SMTP packets to traverse the gateway. And HTTPS is hit and miss.
No Nat rules for transparency are configured, just simply enabling the Web-Proxy.
Is this normal behaviour?