How to pass certain URL to parent proxy in squid?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite












I would like to retrieve certain sites or domains via uplink proxy in squid. I would like to have a list of such sites. How to do that?



I see directive always_direct, but I need opposite: pass all requests directly, but only some of them -- to peer.



Is this possible?










share|improve this question
















bumped to the homepage by Community♦ 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 1




    The opposite of always_direct is never_direct. Not kidding.
    – muru
    Apr 25 '16 at 3:40














up vote
3
down vote

favorite












I would like to retrieve certain sites or domains via uplink proxy in squid. I would like to have a list of such sites. How to do that?



I see directive always_direct, but I need opposite: pass all requests directly, but only some of them -- to peer.



Is this possible?










share|improve this question
















bumped to the homepage by Community♦ 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.










  • 1




    The opposite of always_direct is never_direct. Not kidding.
    – muru
    Apr 25 '16 at 3:40












up vote
3
down vote

favorite









up vote
3
down vote

favorite











I would like to retrieve certain sites or domains via uplink proxy in squid. I would like to have a list of such sites. How to do that?



I see directive always_direct, but I need opposite: pass all requests directly, but only some of them -- to peer.



Is this possible?










share|improve this question















I would like to retrieve certain sites or domains via uplink proxy in squid. I would like to have a list of such sites. How to do that?



I see directive always_direct, but I need opposite: pass all requests directly, but only some of them -- to peer.



Is this possible?







proxy squid






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Apr 25 '16 at 4:56









Alex

3721414




3721414










asked Apr 24 '16 at 6:53









Dims

3151728




3151728





bumped to the homepage by Community♦ 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community♦ 4 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.









  • 1




    The opposite of always_direct is never_direct. Not kidding.
    – muru
    Apr 25 '16 at 3:40












  • 1




    The opposite of always_direct is never_direct. Not kidding.
    – muru
    Apr 25 '16 at 3:40







1




1




The opposite of always_direct is never_direct. Not kidding.
– muru
Apr 25 '16 at 3:40




The opposite of always_direct is never_direct. Not kidding.
– muru
Apr 25 '16 at 3:40










1 Answer
1






active

oldest

votes

















up vote
0
down vote













You use the cache_peer config option to define a peer or parent, and you use cache_peer_access to force all requests matching a particular squid acl to use that peer.



For example:



cache_peer squid2.example.com sibling 3128 3130
acl alwayspeer dstdomain foo.example.com bar.example.com
cache_peer_access squid2.example.com allow alwayspeer


That will force all requests for those two domains (foo.example.com and bar.example.com) to go via the peer (squid2.example.com).



NOTE: alwayspeer is just an arbitrary name I chose for this acl.



If you also want to restrict usage of that peer to ONLY the domains listed in the alwayspeer acl, add the following line:



cache_peer_access squid2.example.com deny !alwayspeer


Any squid acl type can be used, not just dstdomain. e.g. url_regex or urlpath_regex (or dstdom_regex) if you want the acl to regex match part or all of a URL (or domain).



Finally, multiple acls can be allowed or denied with cache_peer_access rules. Note that the order of rules is significant (first matching rule wins).






share|improve this answer




















    Your Answer







    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "106"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f278688%2fhow-to-pass-certain-url-to-parent-proxy-in-squid%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    You use the cache_peer config option to define a peer or parent, and you use cache_peer_access to force all requests matching a particular squid acl to use that peer.



    For example:



    cache_peer squid2.example.com sibling 3128 3130
    acl alwayspeer dstdomain foo.example.com bar.example.com
    cache_peer_access squid2.example.com allow alwayspeer


    That will force all requests for those two domains (foo.example.com and bar.example.com) to go via the peer (squid2.example.com).



    NOTE: alwayspeer is just an arbitrary name I chose for this acl.



    If you also want to restrict usage of that peer to ONLY the domains listed in the alwayspeer acl, add the following line:



    cache_peer_access squid2.example.com deny !alwayspeer


    Any squid acl type can be used, not just dstdomain. e.g. url_regex or urlpath_regex (or dstdom_regex) if you want the acl to regex match part or all of a URL (or domain).



    Finally, multiple acls can be allowed or denied with cache_peer_access rules. Note that the order of rules is significant (first matching rule wins).






    share|improve this answer
























      up vote
      0
      down vote













      You use the cache_peer config option to define a peer or parent, and you use cache_peer_access to force all requests matching a particular squid acl to use that peer.



      For example:



      cache_peer squid2.example.com sibling 3128 3130
      acl alwayspeer dstdomain foo.example.com bar.example.com
      cache_peer_access squid2.example.com allow alwayspeer


      That will force all requests for those two domains (foo.example.com and bar.example.com) to go via the peer (squid2.example.com).



      NOTE: alwayspeer is just an arbitrary name I chose for this acl.



      If you also want to restrict usage of that peer to ONLY the domains listed in the alwayspeer acl, add the following line:



      cache_peer_access squid2.example.com deny !alwayspeer


      Any squid acl type can be used, not just dstdomain. e.g. url_regex or urlpath_regex (or dstdom_regex) if you want the acl to regex match part or all of a URL (or domain).



      Finally, multiple acls can be allowed or denied with cache_peer_access rules. Note that the order of rules is significant (first matching rule wins).






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        You use the cache_peer config option to define a peer or parent, and you use cache_peer_access to force all requests matching a particular squid acl to use that peer.



        For example:



        cache_peer squid2.example.com sibling 3128 3130
        acl alwayspeer dstdomain foo.example.com bar.example.com
        cache_peer_access squid2.example.com allow alwayspeer


        That will force all requests for those two domains (foo.example.com and bar.example.com) to go via the peer (squid2.example.com).



        NOTE: alwayspeer is just an arbitrary name I chose for this acl.



        If you also want to restrict usage of that peer to ONLY the domains listed in the alwayspeer acl, add the following line:



        cache_peer_access squid2.example.com deny !alwayspeer


        Any squid acl type can be used, not just dstdomain. e.g. url_regex or urlpath_regex (or dstdom_regex) if you want the acl to regex match part or all of a URL (or domain).



        Finally, multiple acls can be allowed or denied with cache_peer_access rules. Note that the order of rules is significant (first matching rule wins).






        share|improve this answer












        You use the cache_peer config option to define a peer or parent, and you use cache_peer_access to force all requests matching a particular squid acl to use that peer.



        For example:



        cache_peer squid2.example.com sibling 3128 3130
        acl alwayspeer dstdomain foo.example.com bar.example.com
        cache_peer_access squid2.example.com allow alwayspeer


        That will force all requests for those two domains (foo.example.com and bar.example.com) to go via the peer (squid2.example.com).



        NOTE: alwayspeer is just an arbitrary name I chose for this acl.



        If you also want to restrict usage of that peer to ONLY the domains listed in the alwayspeer acl, add the following line:



        cache_peer_access squid2.example.com deny !alwayspeer


        Any squid acl type can be used, not just dstdomain. e.g. url_regex or urlpath_regex (or dstdom_regex) if you want the acl to regex match part or all of a URL (or domain).



        Finally, multiple acls can be allowed or denied with cache_peer_access rules. Note that the order of rules is significant (first matching rule wins).







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Apr 25 '16 at 1:55









        cas

        38k44495




        38k44495



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f278688%2fhow-to-pass-certain-url-to-parent-proxy-in-squid%23new-answer', 'question_page');

            );

            Post as a guest













































































            Popular posts from this blog

            Peggy Mitchell

            Palaiologos

            The Forum (Inglewood, California)