I've added SPDY to my server last week which is running Varnish for cashing and Nginx as webserver.
Varnish was listening at port 80 and Nginx at 8080 and 443. Traffic at 8080 is redirected using
rewrite ^ https://www.maartenprovo.be$request_uri permanent;
Now however Varnish is listening at port 80 and 443 and Nginx at 8080 and 444.
In /etc/default/varnish I changed
DAEMON_OPTS=”-a :80 \
to
DAEMON_OPTS="-a :80,:443 \
Then I made this for /etc/varnish/defacult.vcl :
backend web {
.host = "127.0.0.1";
.port = "8080";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
.max_connections = 800;
}
# Port 443 Backend Servers for SSL
backend web_ssl {
.host = "127.0.0.1";
.port = "444";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
.max_connections = 800;
}
acl purge {
"localhost";
}
# Respond to incoming requests.
sub vcl_recv {
# Set the director to cycle between web servers.
if (server.port == 443) {
set req.backend = web_ssl;
}
else {
set req.backend = web;
}
...
}
But it doesn't work ... Where did I go wrong?