Use of Variables in Upstream hash Session Persistence Announcing the arrival of Valued...

What is a Meta algorithm?

How to find all the available tools in macOS terminal?

How to bypass password on Windows XP account?

What is the correct way to use the pinch test for dehydration?

Sorting numerically

Right-skewed distribution with mean equals to mode?

Withdrew £2800, but only £2000 shows as withdrawn on online banking; what are my obligations?

How do I keep my slimes from escaping their pens?

Is a manifold-with-boundary with given interior and non-empty boundary essentially unique?

What's the purpose of writing one's academic bio in 3rd person?

Super Attribute Position on Product Page Magento 1

Gastric acid as a weapon

What do you call a phrase that's not an idiom yet?

Models of set theory where not every set can be linearly ordered

Were Kohanim forbidden from serving in King David's army?

The logistics of corpse disposal

Is there a concise way to say "all of the X, one of each"?

Bonus calculation: Am I making a mountain out of a molehill?

What is this single-engine low-wing propeller plane?

Is the address of a local variable a constexpr?

Single word antonym of "flightless"

Why was the term "discrete" used in discrete logarithm?

do i need a schengen visa for a direct flight to amsterdam?

Can inflation occur in a positive-sum game currency system such as the Stack Exchange reputation system?



Use of Variables in Upstream hash Session Persistence



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)nginx: how to allow more than one session per clientConfiguring nginx to retry a single upstream serverLog upstream service in nginx load balancer lognginx' try_files doesn't work with variables from location pattern capturesnginx proxy_pass upstream replace with variablesNginx as reverse proxy with upstream SSL and weak ciphersNginx Redirect allsubdomains to a non-subdomain urlnginx+http2: Upstream prematurely closed connection, PROTOCOL_ERRORupstream timed out(110: Connection timed out) while reading response header from upstream (nginx configuration file has been attached)it's possible use RTMP variables on nginx environment?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















Lets say I have 1 x nginx front end servers which load balances to 2 x app server and requires session persistence.



I can set up an upstream group like this.



upstream backend {



hash $request_uri consistent;
server backend1;
server backend2;
}



If the requests always have a HTTP header called say "x-user-name", I was hoping that I could do this:



hash $http_x_user_name consistent;



but it doesn't seem to work for me..



Does anyone know if this should work? or what variables are available in the upstream context?



I've tried $sent_http_x_user_name and also $upstream_http_x_user_name also.



Would appreciate any help!



NOTE: nginx opensource only.. not pro as I would use 'sticky' if I had the option.



Sam










share|improve this question







New contributor




Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.



























    0















    Lets say I have 1 x nginx front end servers which load balances to 2 x app server and requires session persistence.



    I can set up an upstream group like this.



    upstream backend {



    hash $request_uri consistent;
    server backend1;
    server backend2;
    }



    If the requests always have a HTTP header called say "x-user-name", I was hoping that I could do this:



    hash $http_x_user_name consistent;



    but it doesn't seem to work for me..



    Does anyone know if this should work? or what variables are available in the upstream context?



    I've tried $sent_http_x_user_name and also $upstream_http_x_user_name also.



    Would appreciate any help!



    NOTE: nginx opensource only.. not pro as I would use 'sticky' if I had the option.



    Sam










    share|improve this question







    New contributor




    Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      Lets say I have 1 x nginx front end servers which load balances to 2 x app server and requires session persistence.



      I can set up an upstream group like this.



      upstream backend {



      hash $request_uri consistent;
      server backend1;
      server backend2;
      }



      If the requests always have a HTTP header called say "x-user-name", I was hoping that I could do this:



      hash $http_x_user_name consistent;



      but it doesn't seem to work for me..



      Does anyone know if this should work? or what variables are available in the upstream context?



      I've tried $sent_http_x_user_name and also $upstream_http_x_user_name also.



      Would appreciate any help!



      NOTE: nginx opensource only.. not pro as I would use 'sticky' if I had the option.



      Sam










      share|improve this question







      New contributor




      Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      Lets say I have 1 x nginx front end servers which load balances to 2 x app server and requires session persistence.



      I can set up an upstream group like this.



      upstream backend {



      hash $request_uri consistent;
      server backend1;
      server backend2;
      }



      If the requests always have a HTTP header called say "x-user-name", I was hoping that I could do this:



      hash $http_x_user_name consistent;



      but it doesn't seem to work for me..



      Does anyone know if this should work? or what variables are available in the upstream context?



      I've tried $sent_http_x_user_name and also $upstream_http_x_user_name also.



      Would appreciate any help!



      NOTE: nginx opensource only.. not pro as I would use 'sticky' if I had the option.



      Sam







      nginx






      share|improve this question







      New contributor




      Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question







      New contributor




      Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question






      New contributor




      Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked yesterday









      SamSam

      11




      11




      New contributor




      Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      Sam is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes












          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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
          });


          }
          });






          Sam is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f1425499%2fuse-of-variables-in-upstream-hash-session-persistence%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          Sam is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          Sam is a new contributor. Be nice, and check out our Code of Conduct.













          Sam is a new contributor. Be nice, and check out our Code of Conduct.












          Sam is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Super User!


          • 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%2fsuperuser.com%2fquestions%2f1425499%2fuse-of-variables-in-upstream-hash-session-persistence%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

          Why not use the yoke to control yaw, as well as pitch and roll? Announcing the arrival of...

          Couldn't open a raw socket. Error: Permission denied (13) (nmap)Is it possible to run networking commands...

          VNC viewer RFB protocol error: bad desktop size 0x0I Cannot Type the Key 'd' (lowercase) in VNC Viewer...