Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using nginx as a proxy server in front of Tomcat instances.

There's basic authentication set up, giving access to the demo page just to a few users.

Is it possible to modify the proxy_pass parameter depending on the username provided by the client ?

Basically, if user1, user2, proxy http://host:1234, if user3, user4, proxy http://host:4321.


share|improve this question

You could try using $remote_user variable with Map module to set proxy port.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.