Quantcast
Channel: Nginx Forum
Viewing all articles
Browse latest Browse all 53287

proxy only certain assets based on host header?

$
0
0
We're trying to proxy only certain assets like png|jpg|css only when the host header is a certain DNS name. I tried to do this in the proxy.conf file using something the example below but it doesnt like the if statement. Is there a way to have nginx do what I am looking for?


if ($http_host = dnsname.com) {
location ~ ^/(stylesheets|images|javascripts|tools|flash|components)/ {
proxy_pass http://assethost
}
}

Viewing all articles
Browse latest Browse all 53287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>