Hi there!
My nginx listens on port 80 and serves content from varnish via port 8380 and varnish listens on port 8380 to serve content from the origin.
--- nginx.conf (truncated) ---
http {
upstream varnish{
}
server {
listen 80;
server_name localhost;
#pagespeed config removed for example
location / {
proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_redirect off;
proxy_buffering off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
---
--- varnish: run.sh ---
exec 2>&1
exec varnishd -F -s malloc,512M -u nobody -g nobody -p cli_timeout=30 \
---
--- varnish: backend.vcl ---
backend origin {
.host = "originhost";
.port = "80";
.first_byte_timeout = 300s; # How long to wait before we receive a first byte from our backend?
.connect_timeout = 5s; # How long to wait for a backend connection?
.between_bytes_timeout = 2s; # How long to wait between bytes received from our backend?
}
---
How can all be brought together as Downstream Cache?
Thanks and regards
Christian