Articles of 清漆

nginx>清漆> hhvm

我有nginx在前端解释ssl和redirect所有非httpsstream量到https: server { listen 80; server_name example.com www.example.com; return 301 https://www.example.com$request_uri; } 从那里下一个服务器块解释ssl并传递给清漆: server { listen 443 ssl spdy; server_name example.com www.example.com; …<ssl stuff>… location / { proxy_pass http://127.0.0.1:6081; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Port 443; proxy_set_header Host $host; proxy_redirect off; } } 我已经把所有的东西都清除掉了,以帮助debugging我的问题,因为现在它只是回传给端口8080上的nginx backend default { .host = "127.0.0.1"; […]

光油/ Nginx的/阿帕奇

我正在探索Varnish / Nginx / Apache实现的潜在场景,并对此设置有几个问题。 我期待结合使用所有三个,而不是用NginxreplaceApache。 目前我还不确定Varnish是否应该放在Nginx之前,Nginx会提供静态内容并将dynamic内容传递给Apache,或者放在Nginx和Apache之间? 我应该启用Nginxcaching,甚至启用它,而不是使用光油? 我有一些基于Apache日志处理统计数据的脚本,我可以做些什么来让我的脚本处理整个日志,而不仅仅是只保留dynamic请求统计的Apache日志? 我如何让Varnish将访问统计信息传递给Apache / bginx,因为Apache / Nginx不会logging对caching文件的访问?

caching+ Web服务器在同一台机器上?

我正在准备从一个共享服务器到运行一个站点的独立服务器的实时网站的移动。 现在,我们正在获得大量的stream量,而且Apache正在努力维持。 我正在考虑的新服务器之一是安装caching代理解决scheme(如Varnish)。 唯一的问题是我只有一台机器可以使用,所以Apache和Varnish将在同一个机器上运行。 这只是否定caching或将仍然提高性能? (正如我所看到的:即使在同一台机器上,当一个请求可以通过caching回答时,它不必由Apache渲染,从而减less负载)

在Debian上清除 – 找不到libvarnish.so.1

我试图在Debian 6.0.3上安装Varnish,当我尝试启动服务器时出现以下错误 /usr/sbin/varnishd: error while loading shared libraries: libvarnish.so.1: cannot open shared object file: No such file or directory Runnig ldd 'which varnish'告诉我这个: libvarnish.so.1 => not found libvarnishcompat.so.1 => not found 我也发现这个问题在同一主题,但我的问题是,该文件真的是缺less…

自定义VCL防止清漆开始

操作系统: CentOS 6(x86_64) 我已经安装并configuration了清漆,但现在无法启动。 # service varnish restart Stopping Varnish Cache: [FAILED] Starting Varnish Cache: [FAILED] 我将这个错误缩小到/etc/varnish/default.vcl的另一个VCL文件。 我包括VCL像这样: include "/etc/varnish/domains/playwithbits.vcl"; 如果我清空playwithbits.vcl的内容,然后清漆能够开始,但只要我添加内容失败。 我的playwithbits.vcl的内容是: backend playwithbits { .host = "localhost"; .port = "8080"; } acl purge { if (req.http.Host ~ "playwithbits.com") { "localhost"; } } sub vcl_recv { if (req.http.Host ~ "playwithbits.com") { set req.backend = playwithbits; […]

nginx和varnish for caching forcing ssl

我正在做我的作业,从apache无线caching到nginxcaching,可能通过清漆… … 在阅读了各种博客,文章,服务器故障问题等之后,我知道清漆不能使用ssl,并且该清漆可能比nginx更好地实现dynamic内容的caching。 但是我对于理解nginxcaching是如何工作以及nginx + varnish如何在需要ssl的时候可以一起玩的有点困惑。 下面是怎么实现的,用nginx + varnish还是用nginxcaching? 一些由自定义PHP引擎驱动的url:ie example.com/this-page由example.com/index.php?p=this-page提供 一些url是由wordpress驱动的:ie example.com/blog/this-article由wordpress通过example.com/blog/index.php?p=this-article处理 应该在任何地方强制ssl:即http://example.com/ *redirect到https://example.com/ * www应该redirect到顶级域:即http://www.example.com/ *redirect到https://example.com/ * 所有这些服务caching版本,如果存在的话(如果我明白 – caching是基于时间的,所以如果我更新该页面,我需要调用PURGE清漆路线和手动删除文件,如果Nginx路线)

使用Varnish作为负载平衡器

Varnish已经支持负载均衡HTTP 1.1和Web Socket请求,例如https://www.varnish-cache.org/trac/wiki/LoadBalancing 由于我们已经使用Varnish进行caching,如果我们在Varnish之前添加nginx或ha proxy来进行负载平衡,是否有任何好处,还是应该使用Varnish进行负载平衡? 似乎这种做法相当less见,为什么?

使用Nginx / Varnish / Apachelogging客户端IP

我有Nginx监听端口443作为一个SSL终结者,并代理到同一台服务器上的Varnish未encryption的stream量。 Varnish 3正在处理此stream量,并且stream量直接通过端口80进入。所有stream量都被传递(未encryption)到集群中其他服务器上的Apache实例。 Apache实例使用mod_rpaf将所logging的客户端IPreplace为X-Forwarded-For标头的内容。 我的问题是,如果stream量通过Nginx传递,而'正确的'客户端IP正在loginVarnishNCSA日志,看起来好像Varnish(可以理解)用127.0.0.1下游replaceNginx的X-Forwarded-For头,这是用Apachelogging的。 有没有一个简单的方法来停止Varnish重写X-Forwarded-For如果它已经填充?

如何使用光油健康探针logging时间戳?

我在RHEL 6上使用Varnish 3.0.3作为多个Apache Web服务器前面的caching负载平衡器,并且希望loggingVarnish何时看到后端从健康变为病态,然后再返回。 在命令行中,我可以运行varnishlog -O -I "Back healthy|Went sick"并看到如下所示的行: 0 Backend_health – webserver1 Went sick 4–X— 2 3 5 0.000000 0.000679 0 Backend_health – webserver1 Back healthy 4–X-RH 3 3 5 0.000622 0.000679 HTTP/1.1 200 OK 我很乐意将这些病态/健康状态变化写入日志文件,但是如果没有时间戳记,这些变化就没用了。 如何将这些行写入日志文件,并为每行添加时间戳?

清漆 – cookies

我有以下情况: 在我的网站上,javascript设置了一个包含用于生成标记的相关信息的cookie。 因此,我希望Varnish为每个cookie分别caching每个页面。 我发现的所有文档都说如果存在任何cookie,varnish将不会caching,并解释如何在varnish预处理中删除cookie。 这显然不是我想要的,我想要caching,即使某个cookie存在,但是分别为每个cookie的值。 任何方式来实现这一目标?