<div dir="ltr"><div><div>location ~ ^/(?:stylesheets|images|javascripts|tools|flash|components)/ {<br></div><div>     error_page 418 = @proxied_assets;<br></div><div><br></div>     if ($http_host = <a href="http://dnsname.com">dnsname.com</a>) {<br>
</div>         return 418;<br><div>     }<br><br></div><div>    # add other directives here if need be...<br></div><div><div>}<br><div><br></div><div>location @proxied-assets {<br></div><div>    proxy_pass <a href="http://assethost">http://assethost</a>;<br>
}<br></div><div><br></div></div></div></div><div class="gmail_extra"><br clear="all"><div>----appa<br><br></div>
<br><br><div class="gmail_quote">On Fri, May 24, 2013 at 3:07 AM, amagad <span dir="ltr"><<a href="mailto:nginx-forum@nginx.us" target="_blank">nginx-forum@nginx.us</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
We're trying to proxy only certain assets like png|jpg|css only when the<br>
host header is a certain DNS name. I tried to do this in the proxy.conf file<br>
using something the example below but it doesnt like the if statement. Is<br>
there a way to have nginx do what I am looking for?<br>
<br>
<br>
if ($http_host = <a href="http://dnsname.com" target="_blank">dnsname.com</a>) {<br>
  location ~ ^/(stylesheets|images|javascripts|tools|flash|components)/ {<br>
    proxy_pass <a href="http://assethost" target="_blank">http://assethost</a><br>
  }<br>
}<br>
<br>
Posted at Nginx Forum: <a href="http://forum.nginx.org/read.php?2,239494,239494#msg-239494" target="_blank">http://forum.nginx.org/read.php?2,239494,239494#msg-239494</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div><br></div>