<div dir="ltr"><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small">Hello,</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small"><br>
</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small">I couldn't find much information other than <a href="http://mailman.nginx.org/pipermail/nginx/2008-February/003550.html">this thread</a> which is a dead-end.</div>
<div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small">I would like to add the selected backend/upstream to an "X-Backend" header before dispatching the request to the backend.</div>
<div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small">In Varnish I can do this via:<br>
set req.http.X-Backend = req.backend</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small">
In HAProxy I can do this via:<br>http-send-name-header X-Backend</div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small">
However, I am stumped with Nginx. I imagine I could work around it by redirecting to the same server or some other trickery (not sure if that's a reasonable approach--what would the config look like in any case here?).</div>
<div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small">Any other tips or suggestion are welcome.</div>
<div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small"><br></div><div class="gmail_default" style="font-family:'trebuchet ms',sans-serif;font-size:small">Thanks,</div><div>
<font face="'trebuchet ms', sans-serif">Aleem</font></div>
</div>