nginx proxy_no_cache doesn't workIn Nginx, how can I rewrite all http requests to https while maintaining...

Has Darkwing Duck ever met Scrooge McDuck?

What linear sensor for a keyboard?

A Permanent Norse Presence in America

Is XSS in canonical link possible?

Do the concepts of IP address and network interface not belong to the same layer?

Is there a conventional notation or name for the slip angle?

Can someone explain how this makes sense electrically?

Why we can't differentiate a polynomial equation as many times as we wish?

Greco-Roman egalitarianism

What is the gram­mat­i­cal term for “‑ed” words like these?

Is camera lens focus an exact point or a range?

Journal losing indexing services

Open a doc from terminal, but not by its name

My friend sent me a screenshot of a transaction hash, but when I search for it I find divergent data. What happened?

Why is Arduino resetting while driving motors?

Indicating multiple different modes of speech (fantasy language or telepathy)

Why do IPv6 unique local addresses have to have a /48 prefix?

Is it improper etiquette to ask your opponent what his/her rating is before the game?

Is it possible to use .desktop files to open local pdf files on specific pages with a browser?

Varistor? Purpose and principle

Why did the EU agree to delay the Brexit deadline?

Longest common substring in linear time

Can the Supreme Court overturn an impeachment?

Drawing a topological "handle" with Tikz



nginx proxy_no_cache doesn't work


In Nginx, how can I rewrite all http requests to https while maintaining sub-domain?Need help translating this htaccess rewrite rule to NginxHow mod_cache working with “must-revalidate” and “max-age”?Apache ProxyPass doesn't work for nginxnginx reverse proxy hide login query also on 301 redirect or full qualified urlService Nginx doesn't workNGINX virtual host config for Magento2 in a subfolderNginx location ignore doesn't work with upstreamNginx rewrite url because https doesn't workredirect all web trafic from network through proxy server to a specific URL













2















I am trying to set up a caching reverse proxy with 2 conditions; if either is met, it shouldn't be storing the file from origin:




  • partial-content request

  • request with query string


As configured below, I got nginx to NOT store partial-content requests.

However, it is still storing requests with query string. What am I missing here?



curl -r 1000-2000 http://edge.com/data/abcdef.dat [OK. No file stored.]
wget http://edge.com/data/abcdef.dat?query=string [Not OK. abcdef.dat stored on edge.]




location /data/ {
set $originuri /origin$uri$is_args$args;
errorpage 404 = $originuri;
}

location /origin/ {
proxy_pass http://origin.com:1111;
proxy_store /mnt1/edge/store;
proxy_temp_path /mnt1/edge/tmp;
proxy_set_header If-Range $http_if_range;
proxy_set_header Range $http_range;
proxy_no_cache $http_range $http_if_range $is_args;
}









share|improve this question
















bumped to the homepage by Community 3 mins ago


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




















    2















    I am trying to set up a caching reverse proxy with 2 conditions; if either is met, it shouldn't be storing the file from origin:




    • partial-content request

    • request with query string


    As configured below, I got nginx to NOT store partial-content requests.

    However, it is still storing requests with query string. What am I missing here?



    curl -r 1000-2000 http://edge.com/data/abcdef.dat [OK. No file stored.]
    wget http://edge.com/data/abcdef.dat?query=string [Not OK. abcdef.dat stored on edge.]




    location /data/ {
    set $originuri /origin$uri$is_args$args;
    errorpage 404 = $originuri;
    }

    location /origin/ {
    proxy_pass http://origin.com:1111;
    proxy_store /mnt1/edge/store;
    proxy_temp_path /mnt1/edge/tmp;
    proxy_set_header If-Range $http_if_range;
    proxy_set_header Range $http_range;
    proxy_no_cache $http_range $http_if_range $is_args;
    }









    share|improve this question
















    bumped to the homepage by Community 3 mins ago


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


















      2












      2








      2








      I am trying to set up a caching reverse proxy with 2 conditions; if either is met, it shouldn't be storing the file from origin:




      • partial-content request

      • request with query string


      As configured below, I got nginx to NOT store partial-content requests.

      However, it is still storing requests with query string. What am I missing here?



      curl -r 1000-2000 http://edge.com/data/abcdef.dat [OK. No file stored.]
      wget http://edge.com/data/abcdef.dat?query=string [Not OK. abcdef.dat stored on edge.]




      location /data/ {
      set $originuri /origin$uri$is_args$args;
      errorpage 404 = $originuri;
      }

      location /origin/ {
      proxy_pass http://origin.com:1111;
      proxy_store /mnt1/edge/store;
      proxy_temp_path /mnt1/edge/tmp;
      proxy_set_header If-Range $http_if_range;
      proxy_set_header Range $http_range;
      proxy_no_cache $http_range $http_if_range $is_args;
      }









      share|improve this question
















      I am trying to set up a caching reverse proxy with 2 conditions; if either is met, it shouldn't be storing the file from origin:




      • partial-content request

      • request with query string


      As configured below, I got nginx to NOT store partial-content requests.

      However, it is still storing requests with query string. What am I missing here?



      curl -r 1000-2000 http://edge.com/data/abcdef.dat [OK. No file stored.]
      wget http://edge.com/data/abcdef.dat?query=string [Not OK. abcdef.dat stored on edge.]




      location /data/ {
      set $originuri /origin$uri$is_args$args;
      errorpage 404 = $originuri;
      }

      location /origin/ {
      proxy_pass http://origin.com:1111;
      proxy_store /mnt1/edge/store;
      proxy_temp_path /mnt1/edge/tmp;
      proxy_set_header If-Range $http_if_range;
      proxy_set_header Range $http_range;
      proxy_no_cache $http_range $http_if_range $is_args;
      }






      nginx reverse-proxy






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 20 '12 at 13:59









      pjmorse

      1,14011432




      1,14011432










      asked Sep 6 '12 at 4:22









      nginx-noobnginx-noob

      112




      112





      bumped to the homepage by Community 3 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 3 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 Answer
          1






          active

          oldest

          votes


















          0














          If I'm reading your configuration right, when you pass the request to the origin location for proxying, you're building a URI string which doesn't include a GET query string (i.e. you're flattening the $args). If that's what's happening, it would explain why the origin location isn't seeing $is_args as true.



          This is a hunch on my part - I'd want to look at the request logs to see if it's correct.






          share|improve this answer























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "2"
            };
            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',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f424795%2fnginx-proxy-no-cache-doesnt-work%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0














            If I'm reading your configuration right, when you pass the request to the origin location for proxying, you're building a URI string which doesn't include a GET query string (i.e. you're flattening the $args). If that's what's happening, it would explain why the origin location isn't seeing $is_args as true.



            This is a hunch on my part - I'd want to look at the request logs to see if it's correct.






            share|improve this answer




























              0














              If I'm reading your configuration right, when you pass the request to the origin location for proxying, you're building a URI string which doesn't include a GET query string (i.e. you're flattening the $args). If that's what's happening, it would explain why the origin location isn't seeing $is_args as true.



              This is a hunch on my part - I'd want to look at the request logs to see if it's correct.






              share|improve this answer


























                0












                0








                0







                If I'm reading your configuration right, when you pass the request to the origin location for proxying, you're building a URI string which doesn't include a GET query string (i.e. you're flattening the $args). If that's what's happening, it would explain why the origin location isn't seeing $is_args as true.



                This is a hunch on my part - I'd want to look at the request logs to see if it's correct.






                share|improve this answer













                If I'm reading your configuration right, when you pass the request to the origin location for proxying, you're building a URI string which doesn't include a GET query string (i.e. you're flattening the $args). If that's what's happening, it would explain why the origin location isn't seeing $is_args as true.



                This is a hunch on my part - I'd want to look at the request logs to see if it's correct.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Sep 20 '12 at 14:08









                pjmorsepjmorse

                1,14011432




                1,14011432






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Server Fault!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f424795%2fnginx-proxy-no-cache-doesnt-work%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    117736 Шеррод Примітки | Див. також | Посилання | Навігаційне...

                    As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

                    Маріан Котлеба Зміст Життєпис | Політичні погляди |...