Varnish、Nginx、SSL

Varnish、Nginx、SSL

先週、キャッシュ用に Varnish を、Web サーバーとして Nginx を実行しているサーバーに SPDY を追加しました。

Varnishはポート80でリッスンし、Nginxは8080と443でリッスンしていました。8080のトラフィックは、

rewrite ^ https://www.maartenprovo.be$request_uri permanent;

ただし、現在、Varnish はポート 80 と 443 でリッスンしており、Nginx はポート 8080 と 444 でリッスンしています。

/etc/default/varnishで変更した

DAEMON_OPTS=”-a :80 \

DAEMON_OPTS="-a :80,:443 \

次に、 /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;
  }

...
}

しかし、うまくいきません... どこが間違っていたのでしょうか?

関連情報