INTRODUCTION
After learning how to block website using ban list, so now in this short guide I am going to tell you how to restrict any websites based on keywords in squid proxy server.
Blocking keywords in squid proxy server is very helpful for the system administrators in colleges and schools networks.
`SOLUTION
Let’s start
Same as we make ban_domains list in my previous article, I will store all keywords in ban_keywords.txt file which you wish to block.
Step 1:
create list:
# vi /etc/squid/ban_keywords.txt
Add keywords
gambling spyware bad
Step 2:
Add ACL to block website by reading ban_keywords.txt file.
Edit /etc/squid/squid.conf file:
# vi /etc/squid/squid.conf
ACL:
acl bad_keywords url_regex "/etc/squid/ban_keywords.txt" http_access deny bad_keywords
Step 3:
Restart Squid
# systemctl restart squid.service
Try to search ban keywords in search engine, you will get squid default blocked message in browser.
If you like this Post, please give us your valuable feedback by pressing Vote Up / Vote Down Button. Thanks.
[thumbs-rating-buttons]