nexcess / magento-turpentine

A Varnish extension for Magento.
GNU General Public License v2.0
519 stars 253 forks source link

Checking ESI block candidate .... but not injecting anything. #704

Closed marcosdemasi closed 9 years ago

marcosdemasi commented 9 years ago

I am using Magento ver. 1.9.1 and Varnish 4.0.2 and code from https://github.com/nexcess/magento-turpentine/pull/541 I enabled the logs and realised that despite turpentine_esi.xml file is correct, there is no injections nether ESI blocks is been created. The strange thing is that is was working fine until I create an AMI image (on AWS) and used it to create a new machine.

Any, suggestion, comment, help is welcomed:

Follows is

2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: root
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: head
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: js_cookies
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: google_analytics
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: lightboxes_head
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: jquery_inclusion
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: lightboxes_inclusion
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: cartpro.head
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: after_body_start
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: turpentine_notices
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: header
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_84
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: top.links
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: wishlist_link
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: top.mobinav
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: catalog.topmobinav
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: megaMenu
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: megamenu.list.theme
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: mini-cartpro
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: slideshow
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ibanners.homepage
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: dynamicslideshow.list.default
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: banner-top
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: banner-top2
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: global_notices
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: global_messages
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: home-col-right
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: wordpress.widget.recent_posts
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: catalog.leftcat
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: banner-parceiros
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: content
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: page_content_heading
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: cms.wrapper
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: cms_page
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_88
2014-12-14T19:40:08+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: 0.68597100 1418586008
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_90
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_91
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_90
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_91
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_90
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_91
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_90
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_91
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_90
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_91
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_90
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_91
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_90
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_91
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_90
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_91
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_90
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_91
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_90
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_91
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_90
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_91
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: messages
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: wordpress_posts_associated
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: top.search
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: tablisting
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: banner-bottom
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: slider
2014-12-14T19:40:09+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: slider.list.default
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_92
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_93
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_92
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_93
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_92
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_93
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_92
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_93
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_92
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_93
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_92
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_93
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_92
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_93
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_92
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: ANONYMOUS_93
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: content-bottom
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: slider-logo
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: footer
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: before_body_end
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: belvg.facebookfree.block
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: jsfooter
2014-12-14T19:40:10+00:00 INFO (6): TURPENTINE: Checking ESI block candidate: core_profiler

See result for varnish -b command: varnish -b

*   << BeReq    >> 229463    
-   Begin          bereq 229462 pipe
-   BereqMethod    GET
-   BereqURL       /
-   BereqProtocol  HTTP/1.0
-   BereqHeader    Host: www.menew.com.br
-   BereqHeader    User-Agent: ApacheBench/2.3
-   BereqHeader    Accept: */*
-   BereqHeader    X-Forwarded-For: 187.106.38.246, 187.106.38.246
-   BereqHeader    X-Varnish: 229462
-   BereqHeader    Connection: close
-   VCL_call       PIPE
-   BereqUnset     Connection: close
-   BereqHeader    Connection: close
-   VCL_return     pipe
-   BackendOpen    19 default(127.0.0.1,,8080) 127.0.0.1 42655 
-   Backend        19 default default(127.0.0.1,,8080)
-   BackendClose   19 default(127.0.0.1,,8080)
-   BereqAcct      0 0 0 0 0 0
-   End  

And the default.vcl file:

vcl 4.0;
C{
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <pthread.h>
static pthread_mutex_t lrand_mutex = PTHREAD_MUTEX_INITIALIZER;
void generate_uuid(char* buf) {
pthread_mutex_lock(&lrand_mutex);
long a = lrand48();
long b = lrand48();
long c = lrand48();
long d = lrand48();
pthread_mutex_unlock(&lrand_mutex);
// SID must match this regex for Kount compat /^\w{1,32}$/
sprintf(buf, "frontend=%08lx%04lx%04lx%04lx%04lx%08lx",
a,
b & 0xffff,
(b & ((long)0x0fff0000) >> 16) | 0x4000,
(c & 0x0fff) | 0x8000,
(c & (long)0xffff0000) >> 16,
d
);
return;
}
}C
import std;
backend default {
.host = "127.0.0.1";
.port = "8080";
.first_byte_timeout = 300s;
.between_bytes_timeout = 300s;
}
backend admin {
.host = "127.0.0.1";
.port = "8080";
.first_byte_timeout = 21600s;
.between_bytes_timeout = 21600s;
}
acl crawler_acl {
"127.0.0.1";
}
acl debug_acl {
}
sub generate_session {
if (req.url ~ ".*[&?]SID=([^&]+).*") {
set req.http.X-Varnish-Faked-Session = regsub(
req.url, ".*[&?]SID=([^&]+).*", "frontend=\1");
} else {
C{
char uuid_buf [50];
generate_uuid(uuid_buf);
static const struct gethdr_s VGC_HDR_REQ_VARNISH_FAKED_SESSION =
{ HDR_REQ, "\030X-Varnish-Faked-Session:"};
VRT_SetHdr(ctx,
&VGC_HDR_REQ_VARNISH_FAKED_SESSION,
uuid_buf,
vrt_magic_string_end
);
}C
}
if (req.http.Cookie) {
std.collect(req.http.Cookie);
set req.http.Cookie = req.http.X-Varnish-Faked-Session +
"; " + req.http.Cookie;
} else {
set req.http.Cookie = req.http.X-Varnish-Faked-Session;
}
}
sub generate_session_expires {
C{
time_t now = time(NULL);
struct tm now_tm = *gmtime(&now);
now_tm.tm_sec += 3600;
mktime(&now_tm);
char date_buf [50];
strftime(date_buf, sizeof(date_buf)-1, "%a, %d-%b-%Y %H:%M:%S %Z", &now_tm);
static const struct gethdr_s VGC_HDR_RESP_COOKIE_EXPIRES =
{ HDR_RESP, "\031X-Varnish-Cookie-Expires:"};
VRT_SetHdr(ctx,
&VGC_HDR_RESP_COOKIE_EXPIRES,
date_buf,
vrt_magic_string_end
);
}C
}
sub vcl_recv {
if (req.restarts == 0) {
if (req.http.X-Forwarded-For) {
set req.http.X-Forwarded-For =
req.http.X-Forwarded-For + ", " + client.ip;
} else {
set req.http.X-Forwarded-For = client.ip;
}
}
if (!false || req.http.Authorization ||
req.method !~ "^(GET|HEAD)$" ||
req.http.Cookie ~ "varnish_bypass=1") {
return (pipe);
}
set req.url = regsuball(req.url, "(.*)//+(.*)", "\1/\2");
if (req.http.Accept-Encoding) {
if (req.http.Accept-Encoding ~ "gzip") {
set req.http.Accept-Encoding = "gzip";
} else if (req.http.Accept-Encoding ~ "deflate") {
set req.http.Accept-Encoding = "deflate";
} else {
unset req.http.Accept-Encoding;
}
}
if (req.url ~ "^(/media/|/skin/|/js/|/)(?:(?:index|litespeed)\.php/)?") {
set req.http.X-Turpentine-Secret-Handshake = "1";
if (req.url ~ "^(/media/|/skin/|/js/|/)(?:(?:index|litespeed)\.php/)?painel") {
set req.backend_hint = admin;
return (pipe);
}
if (req.http.Cookie ~ "\bcurrency=") {
set req.http.X-Varnish-Currency = regsub(
req.http.Cookie, ".*\bcurrency=([^;]*).*", "\1");
}
if (req.http.Cookie ~ "\bstore=") {
set req.http.X-Varnish-Store = regsub(
req.http.Cookie, ".*\bstore=([^;]*).*", "\1");
}
if (req.url ~ "/turpentine/esi/get(?:Block|FormKey)/") {
set req.http.X-Varnish-Esi-Method = regsub(
req.url, ".*/method/(\w+)/.*", "\1");
set req.http.X-Varnish-Esi-Access = regsub(
req.url, ".*/access/(\w+)/.*", "\1");
if (req.http.X-Varnish-Esi-Method == "esi" && req.esi_level == 0 &&
!(true || client.ip ~ debug_acl)) {
return (synth(403, "External ESI requests are not allowed"));
}
}
if (req.http.Cookie !~ "frontend=") {
if (client.ip ~ crawler_acl ||
req.http.User-Agent ~ "^(?:ApacheBench/.*|.*Googlebot.*|JoeDog/.*Siege.*|magespeedtest\.com|Nexcessnet_Turpentine/.*)$") {
set req.http.Cookie = "frontend=crawler-session";
} else {
call generate_session;
}
}
if (true &&
req.url ~ ".*\.(?:css|js|jpe?g|png|gif|ico|swf)(?=\?|&|$)") {
unset req.http.Cookie;
unset req.http.X-Varnish-Faked-Session;
return (hash);
}
if (req.url ~ "^(/media/|/skin/|/js/|/)(?:(?:index|litespeed)\.php/)?(?:painel|api|cron\.php)" ||
req.url ~ "\?.*__from_store=") {
return (pipe);
}
if (true &&
req.url ~ "(?:[?&](?:__SID|XDEBUG_PROFILE)(?=[&=]|$))") {
return (pass);
}
if (req.url ~ "[?&](utm_source|utm_medium|utm_campaign|gclid|cx|ie|cof|siteurl)=") {
set req.url = regsuball(req.url, "(?:(\?)?|&)(?:utm_source|utm_medium|utm_campaign|gclid|cx|ie|cof|siteurl)=[^&]+", "\1");
set req.url = regsuball(req.url, "(?:(\?)&|\?$)", "\1");
}
return (hash);
}
}
sub vcl_pipe {
unset bereq.http.X-Turpentine-Secret-Handshake;
set bereq.http.Connection = "close";
}
sub vcl_hash {
hash_data(req.url);
if (req.http.Host) {
hash_data(req.http.Host);
} else {
hash_data(server.ip);
}
hash_data(req.http.Ssl-Offloaded);
if (req.http.X-Normalized-User-Agent) {
hash_data(req.http.X-Normalized-User-Agent);
}
if (req.http.Accept-Encoding) {
hash_data(req.http.Accept-Encoding);
}
if (req.http.X-Varnish-Store || req.http.X-Varnish-Currency) {
hash_data("s=" + req.http.X-Varnish-Store + "&c=" + req.http.X-Varnish-Currency);
}
if (req.http.X-Varnish-Esi-Access == "private" &&
req.http.Cookie ~ "frontend=") {
hash_data(regsub(req.http.Cookie, "^.*?frontend=([^;]*);*.*$", "\1"));
}
return (lookup);
}
sub vcl_hit {
}
sub vcl_backend_response {
set beresp.grace = 15s;
set beresp.http.X-Varnish-Host = bereq.http.host;
set beresp.http.X-Varnish-URL = bereq.url;
if (bereq.url ~ "^(/media/|/skin/|/js/|/)(?:(?:index|litespeed)\.php/)?") {
unset beresp.http.Vary;
set beresp.do_gzip = true;
if (beresp.status != 200 && beresp.status != 404) {
set beresp.ttl = 15s;
set beresp.uncacheable = true;
return (deliver);
} else {
if (beresp.http.Set-Cookie) {
set beresp.http.X-Varnish-Set-Cookie = beresp.http.Set-Cookie;
unset beresp.http.Set-Cookie;
}
unset beresp.http.Cache-Control;
unset beresp.http.Expires;
unset beresp.http.Pragma;
unset beresp.http.Cache;
unset beresp.http.Age;
if (beresp.http.X-Turpentine-Esi == "1") {
set beresp.do_esi = true;
}
if (beresp.http.X-Turpentine-Cache == "0") {
set beresp.ttl = 15s;
set beresp.uncacheable = true;
return (deliver);
} else {
if (true &&
bereq.url ~ ".*\.(?:css|js|jpe?g|png|gif|ico|swf)(?=\?|&|$)") {
set beresp.ttl = 28800s;
set beresp.http.Cache-Control = "max-age=28800";
} elseif (bereq.http.X-Varnish-Esi-Method) {
if (bereq.http.X-Varnish-Esi-Access == "private" &&
bereq.http.Cookie ~ "frontend=") {
set beresp.http.X-Varnish-Session = regsub(bereq.http.Cookie,
"^.*?frontend=([^;]*);*.*$", "\1");
}
if (bereq.http.X-Varnish-Esi-Method == "ajax" &&
bereq.http.X-Varnish-Esi-Access == "public") {
set beresp.http.Cache-Control = "max-age=" + regsub(
bereq.url, ".*/ttl/(\d+)/.*", "\1");
}
set beresp.ttl = std.duration(
regsub(
bereq.url, ".*/ttl/(\d+)/.*", "\1s"),
300s);
if (beresp.ttl == 0s) {
set beresp.ttl = 15s;
set beresp.uncacheable = true;
return (deliver);
}
} else {
set beresp.ttl = 3600s;
}
}
}
return (deliver);
}
}
sub vcl_deliver {
if (req.http.X-Varnish-Faked-Session) {
call generate_session_expires;
set resp.http.Set-Cookie = req.http.X-Varnish-Faked-Session +
"; expires=" + resp.http.X-Varnish-Cookie-Expires + "; path=/";
if (req.http.Host) {
set resp.http.Set-Cookie = resp.http.Set-Cookie +
"; domain=" + regsub(req.http.Host, ":\d+$", "");
}
set resp.http.Set-Cookie = resp.http.Set-Cookie + "; httponly";
unset resp.http.X-Varnish-Cookie-Expires;
}
if (req.http.X-Varnish-Esi-Method == "ajax" && req.http.X-Varnish-Esi-Access == "private") {
set resp.http.Cache-Control = "no-cache";
}
if (true || client.ip ~ debug_acl) {
set resp.http.X-Varnish-Hits = obj.hits;
set resp.http.X-Varnish-Esi-Method = req.http.X-Varnish-Esi-Method;
set resp.http.X-Varnish-Esi-Access = req.http.X-Varnish-Esi-Access;
set resp.http.X-Varnish-Currency = req.http.X-Varnish-Currency;
set resp.http.X-Varnish-Store = req.http.X-Varnish-Store;
} else {
unset resp.http.X-Varnish;
unset resp.http.Via;
unset resp.http.X-Powered-By;
unset resp.http.Server;
unset resp.http.X-Turpentine-Cache;
unset resp.http.X-Turpentine-Esi;
unset resp.http.X-Turpentine-Flush-Events;
unset resp.http.X-Turpentine-Block;
unset resp.http.X-Varnish-Session;
unset resp.http.X-Varnish-Host;
unset resp.http.X-Varnish-URL;
unset resp.http.X-Varnish-Set-Cookie;
}
}
prysie commented 9 years ago

Did you resolve this? I have a similar issue I am struggling to resolve.

marcosdemasi commented 9 years ago

Hi, prysie. Try to disable/clean cache and then run Turpentine again.

I hope this helps

prysie commented 9 years ago

Hi - thanks for responding, I have reapplied Vcl and cleared cache many times, but it does not seem to help my issue. My esi blocks are been injected as URLs within the page element but instead of redirecting it is putting the message 'this is permanently moved to here' clicking on the here displays the right content - I'm not 100% my turpentine_esi.xml is setup to handle all my custom theme elements but I'd still expect the basics like the footer block to work. Anyway thanks for responding I have found a wealth of knowledge in people's comments in this and other forums.

aricwatson commented 9 years ago

@prysie Can you post your log? Also, it's generally a better idea to put any ESI policy changes into a local.xml file to avoid losing any changes when you update the extension.

prysie commented 9 years ago

@aricwatson I will apply your new release this weekend and try this all again, if I still have issues I will post the logs etc here

aricwatson commented 9 years ago

Thanks!

aricwatson commented 9 years ago

Closing for lack of feedback.

ahofstetter commented 9 years ago

I'm seeing this exact same issue after installing turpentine for the first time. The blocks I expect to be replaced by esi show the message: "Moved Permanently The document has moved here. Apache/2.4.10 (Linux/SUSE) Server at www.domain.com Port 80" Where 'here' contains a link to the controller action to render the esi block, example: http://www.domain.com/turpentine/esi/getBlock/method/esi/access/private/ttl/18000/hmac/62f23c55a6952914297c2d172d35a945ffb54b0c542d1f5c9bd726394dec1bae/data/RaMIDT0wgiLyO5TXtXPiri2ytSGVn2hD-Ue6t9krZTVjhiU-...

I haven't added any xml changes, I am only using the turpentine_esi.xml that was provided. No modifications have been made yet. Using Magento EE 1.14.1.0 Have flushed cache, restarted varnish many times without change Any idea what I am doing wrong? Thanks

aricwatson commented 9 years ago

It sounds like some sort of a redirect is occurring at the apache level. Is there anything that seems to be related in your logs? What version of Varnish?

ahofstetter commented 9 years ago

Hi, Thanks for the reply. Varnish version 3.0.5 I found the problem. You are correct, it was an apache level redirect in an .htaccess rule I had setup for redirecting all url's with a trailing slash to urls without. When I added an exclusion to this rule for the turpentine route, this problem stopped. Everything looks much better now, thanks!

prysie commented 9 years ago

Can you post the exclusion rule configuration here? It would help me out thanks :)

aricwatson commented 9 years ago

Closing for now, but feel free to reply if we can still help out.