http://nginx.org/packages/debian/ wheezy nginx deb-‐src http://nginx.org/packages/debian/ wheezy nginx Go to h&p://wiki.nginx.org/Pgp for PGP signature Go to h&p://wiki.nginx.org/Install for more info
11 ReqStart c 12.12.12.1 53727 1401010767 11 RxRequest c GET 11 RxURL c / 11 RxProtocol c HTTP/1.1 11 RxHeader c Host: 12.12.12.6 11 RxHeader c User-‐Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20100101 Firefox/17.0 11 RxHeader c Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/ *;q=0.8 11 RxHeader c Accept-‐Language: nl,en;q=0.7,fr-‐be;q=0.3 11 RxHeader c Accept-‐Encoding: gzip, deflate 11 RxHeader c Connection: keep-‐alive 11 VCL_call c recv lookup 11 VCL_call c hash 11 Hash c / 11 Hash c 12.12.12.6 11 VCL_return c hash 11 VCL_call c miss fetch 11 Backend c 13 default default 11 TTL c 1401010767 RFC 0 -‐1 -‐1 1357920021 0 1357920020 0 0 11 VCL_call c fetch 11 TTL c 1401010767 VCL 120 -‐1 -‐1 1357920021 -‐0 11 VCL_return c hit_for_pass 11 ObjProtocol c HTTP/1.1 11 ObjResponse c OK 11 ObjHeader c Date: Fri, 11 Jan 2013 16:00:20 GMT 11 ObjHeader c Server: Apache 11 ObjHeader c X-‐Powered-‐By: PHP/5.3.2-‐1ubuntu4.18 11 ObjHeader c Cache-‐Control: no-‐cache, no-‐store, max-‐age=0 Client
11 ObjProtocol c HTTP/1.1 11 ObjResponse c OK 11 ObjHeader c Date: Fri, 11 Jan 2013 16:00:20 GMT 11 ObjHeader c Server: Apache 11 ObjHeader c X-‐Powered-‐By: PHP/5.3.2-‐1ubuntu4.18 11 ObjHeader c Cache-‐Control: no-‐cache, no-‐store, max-‐age=0 11 ObjHeader c Vary: Accept-‐Encoding 11 ObjHeader c Content-‐Encoding: gzip 11 ObjHeader c Content-‐Length: 119 11 ObjHeader c Content-‐Type: text/html 11 Gzip c u F -‐ 119 336 80 80 887 11 VCL_call c deliver deliver 11 TxProtocol c HTTP/1.1 11 TxStatus c 200 11 TxResponse c OK 11 TxHeader c Server: Apache 11 TxHeader c X-‐Powered-‐By: PHP/5.3.2-‐1ubuntu4.18 11 TxHeader c Cache-‐Control: no-‐cache, no-‐store, max-‐age=0 11 TxHeader c Vary: Accept-‐Encoding 11 TxHeader c Content-‐Encoding: gzip 11 TxHeader c Content-‐Type: text/html 11 TxHeader c Content-‐Length: 119 11 TxHeader c Accept-‐Ranges: bytes 11 TxHeader c Date: Fri, 11 Jan 2013 16:00:20 GMT 11 TxHeader c X-‐Varnish: 1401010767 11 TxHeader c Age: 0 11 TxHeader c Via: 1.1 varnish 11 TxHeader c Connection: keep-‐alive 11 Length c 119 11 ReqEnd c 1401010767 1357920020.712090731 1357920020.727306366 0.000087738 Client
BackendOpen b default 127.0.0.1 51597 127.0.0.1 8080 13 TxRequest b GET 13 TxURL b / 13 TxProtocol b HTTP/1.1 13 TxHeader b Host: 12.12.12.6 13 TxHeader b User-‐Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20100101 Firefox/17.0 13 TxHeader b Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/ *;q=0.8 13 TxHeader b Accept-‐Language: nl,en;q=0.7,fr-‐be;q=0.3 13 TxHeader b X-‐Forwarded-‐For: 12.12.12.1 13 TxHeader b X-‐Varnish: 1401010767 13 TxHeader b Accept-‐Encoding: gzip 13 RxProtocol b HTTP/1.1 13 RxStatus b 200 13 RxResponse b OK 13 RxHeader b Date: Fri, 11 Jan 2013 16:00:20 GMT 13 RxHeader b Server: Apache 13 RxHeader b X-‐Powered-‐By: PHP/5.3.2-‐1ubuntu4.18 13 RxHeader b Cache-‐Control: no-‐cache, no-‐store, max-‐age=0 13 RxHeader b Vary: Accept-‐Encoding 13 RxHeader b Content-‐Encoding: gzip 13 RxHeader b Content-‐Length: 119 13 RxHeader b Content-‐Type: text/html 13 Fetch_Body b 4(length) cls 0 mklen 1 13 Length b 119 13 BackendReuse b default Backend
11 ReqStart c 12.12.12.1 53727 1401010767 11 RxRequest c GET 11 RxURL c / 11 RxProtocol c HTTP/1.1 11 RxHeader c Host: 12.12.12.6 11 RxHeader c User-‐Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:17.0) Gecko/20100101 Firefox/17.0 11 RxHeader c Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/ *;q=0.8 11 RxHeader c Accept-‐Language: nl,en;q=0.7,fr-‐be;q=0.3 11 RxHeader c Accept-‐Encoding: gzip, deflate 11 RxHeader c Connection: keep-‐alive 11 VCL_call c recv lookup 11 VCL_call c hash 11 Hash c / 11 Hash c 12.12.12.6 11 VCL_return c hash 11 VCL_call c miss fetch 11 Backend c 13 default default 11 TTL c 1401010767 RFC 0 -‐1 -‐1 1357920021 0 1357920020 0 0 11 VCL_call c fetch 11 TTL c 1401010767 VCL 120 -‐1 -‐1 1357920021 -‐0 11 VCL_return c hit_for_pass 11 ObjProtocol c HTTP/1.1 11 ObjResponse c OK 11 ObjHeader c Date: Fri, 11 Jan 2013 16:00:20 GMT 11 ObjHeader c Server: Apache 11 ObjHeader c X-‐Powered-‐By: PHP/5.3.2-‐1ubuntu4.18 11 ObjHeader c Cache-‐Control: no-‐cache, no-‐store, max-‐age=0 Got it?
= one; .weight=1; } { .backend = two; .weight=1; } } sub vcl_recv { set req.backend = localhosts; //Load balance by client IP, this is the default set client.identity = client.ip; } IP hash Uses client.identity
stale response was used due to proxy/ fastcgi_cache_use_stale updating ✓STALE ➡expired, stale response was used due to proxy/ fastcgi_cache_use_stale ✓HIT HIT/MISS marker add_header X-‐Cache $upstream_cache_status;