How to Create an HTTP Proxy Using Squid on CentOS 7

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Marin Todorov

I am a bachelor in computer science and a Linux Foundation Certified System Administrator. Currently working as a Senior Technical support in the hosting industry. In my free time I like testing new software and inline skating.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

14 Responses

  1. Cesar Martinez says:

    But for this configuration use a certificate that you must issue on the server, this does not go against the citations issued by each website?

    • Ravi Saive says:


      I really never tried with HTTPS blocking on squid, so I have no idea about it. But I think there must be a way to block HTTPS website, let me look into this..

  2. Amin Vakil says:


    I can’t reply anymore so I’m opening another answer, I had already done that, could you please check my configuration:

    • Ravi Saive says:


      The squid configuration seems perfect, but it’s all Google’s new features which is blocking Youtube vidoes from caching.

  3. Cesar Martinez says:


    It does not block squid https since it does not block anything that passes through port 443, iptables must be used. I tried Facebook with YouTube and it does not filter

  4. Prakash Naikade says:

    What if I want to block particular website for particular time duration ?

    • Ravi Saive says:


      Yes, you can block any website for specific time using ACL, for example here I am restricting access to facebook for specific hours of the day with squid i.e. in morning 08:00-09:00.

      acl facebooktime time MTWHF 09:00-10:00
      acl FBDomain  dstdomain
      http_access allow FBDomain facebooktime
      http_access deny  FBDomain
  5. Cesar Martinez says:

    Excellent post, but how can you block access to https sites with squid.

    • Ravi Saive says:


      Just place the domain names in the /etc/squid/blacklisted_sites.acl file that you want to block whether it HTTP or HTTPS, everything is blocked..

  6. Amin Vakil says:

    I’ve setup my squid a while ago on ubuntu 16.04 and recently on centos 7 just like this article says.

    I have problems with few websites like &, they’re just these two, although I can curl both websites but I cannot view them via squid.

    What am I missing?

    • Ravi Saive says:


      I know about this issue since very long time, squid proxy doesn’t play Youtube videos, due to its several ‘features’ that prevent their flash videos being effectively distributed by caches.

      You should check this article for solution –

      • Amin Vakil says:


        It didn’t work out for me, also at the top of page is written:

        {X} {X} {X} Google\YouTube changed their system to be more secure and due to this the article in it’s current state is not applicable. You will need to use Content Adaptation to achive YT caching and it’s not a beginne’s task.

        • Ravi Saive says:


          Try this trick, hope it work..

          Open your squid configuration file and search for dns_v4_first off and change it to dns_v4_first on.

          Restart squid and it should work now.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.