Hi  guys ,<br><br>Im using nginx with varnish,  and i have following  two virtual-host <b>[ <a href="http://content.com">content.com</a>, <a href="http://content.org">content.org</a> ]  </b>configuration in nginx  <br><br>
With follwing configuration   varnish only cache the content of the <b><a href="http://content.org">content.org</a> </b> , its not caching the <b><a href="http://content.com">content.com</a></b> , Do i need to define multiple back-ends for each virtual-hosts, can any one giude me how to do that .Or do i need to configure  separate Varnish instance for each VHOST.<br>
<br><br>Im not try to cache the https contents , only http need to cache.<br><br><br>This is my configuration...<br><br><br>Configuration<br>-------------------<br><br><b><a href="http://content.com">content.com</a></b><br>
===========<br><br>server {<br>    listen      <a href="http://10.100.1.1:8080">10.100.1.1:8080</a>;<br>    server_name   <a href="http://content.com">content.com</a>;<br>    access_log /var/log/nginx/content.com.log;<br>
        root /var/www/<a href="http://content.com">content.com</a>;<br>        expires       14d;<br>        add_header Cache-Control  public;<br>  }<br><br><br>server {<br>    listen      <a href="http://10.100.1.1:443">10.100.1.1:443</a>;<br>
    server_name   <a href="http://content.com">content.com</a>;<br>    access_log /var/log/nginx/content.com.log;<br>        root /var/www/<a href="http://content.com">content.com</a>;<br>        expires       14d;<br>        add_header Cache-Control  public;<br>
<br>        ssl                 on;<br>        ssl_certificate     /etc/nginx/ssl/content.pem;<br>        ssl_certificate_key /etc/nginx/ssl/content.key;<br><br>     <br>  }<br><br><br><b><a href="http://content.org">content.org</a><br>
============</b><br><br> server {<br>                listen      <a href="http://10.100.1.2:8080">10.100.1.2:8080</a> default;<br>                server_name  <a href="http://cache.org">cache.org</a>;<br>                {<br>
                        root   /home/httpd/<a href="http://content.org">content.org</a>;<br>                        autoindex on;<br>                }<br>        }<br><br>     server {<br>                listen  <a href="http://10.100.1.2:443">10.100.1.2:443</a>;<br>
                ssl    on;<br>                ssl_certificate    /etc/nginx/ssl/content-org.pem;<br>                ssl_certificate_key    /etc/nginx/ssl/content-org.key;<br><br>                server_name <a href="http://content.org">content.org</a>;<br>
<br>                {<br>                root   /home/httpd/<a href="http://content.org">content.org</a>;<br>                autoindex on;<br>                }<br><br><br><br><b>This is my  varnish default.vcl<br>======================</b><br>
<br>backend default {<br>    .host = "10.100.1.2";<br>    .port = "8080";<br>}<br><br>sub vcl_fetch {<br>     if (!beresp.cacheable) {<br>                        unset beresp.http.expires;<br>                        set beresp.http.cache-control = "max-age=900";<br>
                        set beresp.ttl = 1w;<br>                        set beresp.http.magicmarker = "1";<br>         return (pass);<br>     }<br>     if (beresp.http.Set-Cookie) {<br>         return (pass);<br>
     }<br>     return (deliver);<br> }<br> sub vcl_deliver {<br>     return (deliver);<br> }<br><br><br><br><br><br>Thanks in advance<br><br><br>Thank You<br>Dhanushka<br><br><br><br><br><br><br><br><br>