Yes, very easily with 0.7.x and above. It would be something like
below ( check Module ngx_http_core_module )
location / {
try_files @varnish@application;
}
location @varnish {
// proxy to varnish
}
location @application {
// proxy to application
}
– Merlin
I tried a config like this on 0.8.6 and I found that all requests ended
up going to the @application proxy, skipping the @varnish proxy
entirely. Am I doing something wrong?
Here’s a sample of my config:
upstream varnishservers
{
server 10.1.1.1:80;
}
upstream originservers
{
server 10.1.1.2:80;
server 10.1.1.2:80;
}
server
{
listen 8080;
server_name _;
server_name_in_redirect off;
I tried a config like this on 0.8.6 and I found that all requests ended
up going to the @application proxy, skipping the @varnish proxy
entirely. Am I doing something wrong?
Here’s a sample of my config:
location /
{
try_files @vanish@origin;
}
Thanks!
Hi,
You seem to have put it as @vanish instead of @varnish.
Is that causing you the issue?
Vishnu
Sorry, bad copy/paste job Those are correct in the config I’m using.
I tried a config like this on 0.8.6 and I found that all requests ended
up going to the @application proxy, skipping the @varnish proxy
entirely. Am I doing something wrong?
Here’s a sample of my config:
location /
{
try_files @vanish@origin;
}
Thanks!
Hi,
You seem to have put it as @vanish instead of @varnish.
Is that causing you the issue?
I tried a config like this on 0.8.6 and I found that all requests ended
up going to the @application proxy, skipping the @varnish proxy
entirely. Am I doing something wrong?
Here’s a sample of my config:
location /
{
try_files @vanish@origin;
}
Thanks!
Hi,
You seem to have put it as @vanish instead of @varnish.
Is that causing you the issue?
Vishnu
Sorry, bad copy/paste job Those are correct in the config I’m using.
Any ideas? Does that look right?
I just tried this and the root document of the website hits the varnish
servers, but every other request doesn’t. Could there be a pathing
problem going on here?