<div dir="ltr">Turns out my if statment just neede a "break;"...<br>.<br>if ($host = '<a href="http://secondary.example.com/" target="_blank">secondary.example.com</a>') { <br> proxy_pass <a href="http://secondary/" target="_blank">http://secondary</a>;<br>
break;<br>}<br><br>Thanks.<br>-Jake<br><br><div class="gmail_quote">On Sun, Aug 3, 2008 at 4:37 PM, J Davis <span dir="ltr"><<a href="mailto:mrsalty0@gmail.com">mrsalty0@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div dir="ltr">Should it be possible to use a different proxy_pass statement under a single location using if statement?<br>I've tried using the following config but all traffic gets passed to the 'primary' upstream regardless of the value of $host.<br>
<br>upstream primary {<br> server x.x.x.x;<br> }<br> <br>upstream secondary {<br> server x.x.x.x;<br> }<br><br>location / {<br> if ($host = '<a href="http://secondary.example.com" target="_blank">secondary.example.com</a>') { <br>
proxy_pass <a href="http://secondary" target="_blank">http://secondary</a>;<br> }<br> proxy_set_header Host $http_host;<br> proxy_pass <a href="http://primary" target="_blank">http://primary</a>;<br>
}<br>
<br>Many thanks,<br>-Jake<br></div>
</blockquote></div><br></div>