我正在托pipe一个正在发送适当的caching控制标题的REST服务。 我使用Varnish作为Web服务器前面的caching服务器。 但是,清漆的限制是它不支持cachingHTTP POST和HTTP PUT。 有没有其他caching服务器可以caching这些请求? 我知道,cachingPOST是有点棘手,因为你不能只是caching基于URL作为一个关键像GET; 它需要实际检查请求主体。 在multipart/form-data请求的情况下,caching请求体的大小应该是有限制的(这样大file upload等不会被caching)。 不过,我真的希望能够caching简短的HTTP POST,或者至less是application/x-www-form-urlencoded 。
我想在我的varnishncsa日志中包含以下信息(我需要将某些问题与特定用户联系起来)。 请求内容 与完整内容的cookie XID 在阅读https://www.varnish-cache.org/docs/trunk/reference/varnishncsa.html我不太确定我是如何实现它的。 顺便说一句,我不能添加“varnishncsa”标签的问题 – 有人可以添加它(具有较高的声誉?:P)。
我正在查看现有应用程序的设置。 这个应用程序使用亚马逊的弹性负载平衡器,然后通过清漆。 在清漆,我们正在利用循环负载平衡器…这是多余的? 我的设置的一个例子 我们使用director作为round-robin 。
设置 我使用Logstash从Varnish收集统计信息, Logstashconfiguration为根据服务器日志中的虚拟主机和结果代码来增加statsd计数器。 我也有碳为石墨创造耳语档案。 我正在从varnishncsa读取日志,该日志configuration为向标准日志添加虚拟主机和请求处置: VARNISHNCSA_LOG_FORMAT="%h %l %u %t \"%r\" %s %b \"%{Referer}i\" \"%{User-agent}i\" %{Host}i %{Varnish:hitmiss}x" 我的logstash托运人configuration如下所示: input { file { path => "/var/log/varnish/varnishncsa.log" type => varnish } } filter { grok { type => varnish pattern => "%{COMBINEDAPACHELOG} %{NOTSPACE:vhost} %{WORD:varnish_handling}" pattern => "%{COMBINEDAPACHELOG}" } mutate { rename => [ 'response', 'status' ] } } […]
在vcl_recv我决定是否通过或查找基于cookie的存在: sub vcl_recv { if (req.http.Cookie ~ "(JSESSIONID=)" ) { /* do not cache logged in users */ return (pass); } return (lookup); } 在vcl_fetch我微调caching的一些网页: sub vcl_fetch { /* custom rules block */ if (req.url ~ "^/foo") { set beresp.ttl=30s; } if (req.url ~ "^/bar") { set beresp.ttl=1m; } if (req.url ~ "^/123") { set […]
我正在使用下面的configurationmonit set daemon 30 check process varnish with pidfile /var/run/varnishd.pid if failed host www.hatchedbyyolk.com port 80 protocol http and request "/monit-check-url" then exec "/root/scripts/varnish_restart.sh" set httpd port 2812 and use address localhost allow localhost monit开始就好,但monit status显示如下 Process 'varnish' status Does not exist monitoring status monitored data collected Sun Oct 13 00:37:03 2013 由于某些未知的原因,启动和停止命令对清漆没有影响,所以我使用/root/scripts/varnish_restart.sh这个脚本 #! /bin/sh […]
我一直在这个工作了一段时间,似乎无法find任何解决scheme。 我坐在我的nginx服务器前面的清漆,CloudFlare坐在前面。 当我发出一个curl -X PURGE主机时,CloudFlare会挑选它,当然会拒绝503错误。 如果我使用direct.host来绕过CloudFlare,它会触发Varnish服务器,并接受请求,但它不会执行任何操作,因为不使用direct.host,所以caching中没有任何内容。 我使用的是WordPress,并且有一个WordPress Varnish Purge插件,它说要将以下行添加到wp-config.php : define('VHP_VARNISH_IP','127.0.0.1') 这是特别与代理服务器和/或CloudFlare,以确保请求去清漆服务器而不是CloudFlare,但似乎没有帮助。 任何人以前看到这个,有什么想法?
我在Centos上运行, 麻烦的是,当我重新启动我的服务器,我需要启动我的Apache和清漆服务 我用这个来启动它们 service httpd restart && service varnish restart 但是,我想他们两人开始,当我重新启动服务器 我读了我可以使用这个 chkconfig httpd on 但是,这只是为了Apache可以做到这一点 chkconfig varnish on 最后,当我通常开始httpd的时候,我被要求提供SSL的api密钥,我能够在启动时将这个信息合并到varnish和httpd中。 或者我注定每次运行此命令我重新启动
这是具体的问题。 一个Nginx服务器(称为N1)侦听:80,并通过proxy_pass转发清漆Varnish在127.0.0.1:6081侦听,并转发到8080上的Nginx(N2)。N2与php-fpm套接字进行通信。 N1 <> V <> N2 <>点 N1: location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_pass http://varnish/; proxy_redirect off; } 目前 $ _SERVER ['REMOTE_ADDR'] =='127.0.0.1' 期望 $ _SERVER ['REMOTE_ADDR'] =='真正的远程地址'
我正在尝试使用mod_pagespeed设置Varnish 4 + Nginx。 根据本文档,我正在使用以下configurationVarnish 4: https://developers.google.com/speed/pagespeed/module/downstream-caching 我使用的configuration没有提供任何错误,但是我几乎没有从Varnish的caching命中 MAIN.cache_hit 80 MAIN.cache_miss 347 完整的.vclconfiguration: # Marker to tell the VCL compiler that this VCL has been adapted to the # new 4.0 format. vcl 4.0; import std; # Block 1: Define upstream server's host and port. Set this to point to your # content server. backend […]