Ignore certain URLs on Varnish CacheVarnish Cache - default TTL?Purge varnish cache for a single url using...
The need of reserving one's ability in job interviews
Calculating Hyperbolic Sin faster than using a standard power series
Can we carry rice to Japan?
Change only a specific Parameter on a function
Is there any relevance to Thor getting his hair cut other than comedic value?
Pure Functions: Does "No Side Effects" Imply "Always Same Output, Given Same Input"?
What is a term for a function that when called repeatedly, has the same effect as calling once?
Is divide-by-zero a security vulnerability?
Sometimes a banana is just a banana
It took me a lot of time to make this, pls like. (YouTube Comments #1)
Create chunks from an array
Can a space-faring robot still function over a billion years?
Second-story floor leveling question for new home
Why won't the strings command stop?
What happened to QGIS 2.x LTR?
What should the omniscient narrator call a character?
Do you continue making death saving throws while petrified?
Should we avoid writing fiction about historical events without extensive research?
Is there a math equivalent to the conditional ternary operator?
"Lived a lion" or "there lived a lion"
Why can't we make a perpetual motion machine by using a magnet to pull up a piece of metal, then letting it fall back down?
How to play ethic aspects my character is said to have, I as player don't understand?
In Adventurer's League, is it possible to keep the Ring of Winter if you manage to acquire it in the Tomb of Annihilation adventure?
I encountered my boss during an on-site interview at another company. Should I bring it up when seeing him next time?
Ignore certain URLs on Varnish Cache
Varnish Cache - default TTL?Purge varnish cache for a single url using varnishadmApache / Nginx / Varnish - GZIP does not work on css, jsIgnore utm_* values with varnish?Will Varnish recreate cache?Varnish 3 ignore the req.backend directiveVarnish: Cache all content until a certain date?Varnish: Ignore cookiesHow to enable 2nd site on Nginx + Varnish cacheVarnish Cache - Cache Only Seems warmed on each browser
I'd like that Varnish completely ignored certain URLs on my websites.
I.e., www.site1.com/fileuploader and www.site2.com/fileuploader
I have 4 websites on the same VCL, and all those websites are using the same URL structure so the only thing that changes is the domain itself, the URLs I want Varnish to ignore are the same.
I've tried:
sub vcl_recv {
if (req.url ~ "^/fileuploader/?"
) {
return(pipe);
}
}
But it doesn't work. When trying to download a PDF through it I'm presented with a Varnish 503 Unavailable error (the same error I have if I didn't change the config). If I go through nginx directly using its port, it downloads fine.
Here's the varnishlog for this incident:
16 ObjHeader - Server: nginx/1.2.7
16 ObjHeader - Date: Wed, 17 Apr 2013 11:03:40 GMT
16 ObjHeader - Content-Type: application/pdf
16 ObjHeader - Content-Length: 1078550
16 ObjHeader - X-Powered-By: PHP/5.3.23-1~dotdeb.0
16 ObjHeader - Expires: Thu, 19 Nov 1981 08:52:00 GMT
16 ObjHeader - Set-Cookie: frontend=74go8sgckma5qrobnqc36pcjd4; expires=Wed, 17-Apr-2013 12:03:40 GMT; path=/; domain=www.site1.com; httponly
16 ObjHeader - Pragma: public
16 ObjHeader - Cache-Control: must-revalidate, post-check=0, pre-check=0
16 ObjHeader - Content-Disposition: attachment; filename=File-1338990998.pdf
16 ObjHeader - Content-Encoding: gzip
16 ObjHeader - Vary: Accept-Encoding
30 FetchError - Resource temporarily unavailable
16 FetchError - straight insufficient bytes
nginx cache varnish
bumped to the homepage by Community♦ 4 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'd like that Varnish completely ignored certain URLs on my websites.
I.e., www.site1.com/fileuploader and www.site2.com/fileuploader
I have 4 websites on the same VCL, and all those websites are using the same URL structure so the only thing that changes is the domain itself, the URLs I want Varnish to ignore are the same.
I've tried:
sub vcl_recv {
if (req.url ~ "^/fileuploader/?"
) {
return(pipe);
}
}
But it doesn't work. When trying to download a PDF through it I'm presented with a Varnish 503 Unavailable error (the same error I have if I didn't change the config). If I go through nginx directly using its port, it downloads fine.
Here's the varnishlog for this incident:
16 ObjHeader - Server: nginx/1.2.7
16 ObjHeader - Date: Wed, 17 Apr 2013 11:03:40 GMT
16 ObjHeader - Content-Type: application/pdf
16 ObjHeader - Content-Length: 1078550
16 ObjHeader - X-Powered-By: PHP/5.3.23-1~dotdeb.0
16 ObjHeader - Expires: Thu, 19 Nov 1981 08:52:00 GMT
16 ObjHeader - Set-Cookie: frontend=74go8sgckma5qrobnqc36pcjd4; expires=Wed, 17-Apr-2013 12:03:40 GMT; path=/; domain=www.site1.com; httponly
16 ObjHeader - Pragma: public
16 ObjHeader - Cache-Control: must-revalidate, post-check=0, pre-check=0
16 ObjHeader - Content-Disposition: attachment; filename=File-1338990998.pdf
16 ObjHeader - Content-Encoding: gzip
16 ObjHeader - Vary: Accept-Encoding
30 FetchError - Resource temporarily unavailable
16 FetchError - straight insufficient bytes
nginx cache varnish
bumped to the homepage by Community♦ 4 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'd like that Varnish completely ignored certain URLs on my websites.
I.e., www.site1.com/fileuploader and www.site2.com/fileuploader
I have 4 websites on the same VCL, and all those websites are using the same URL structure so the only thing that changes is the domain itself, the URLs I want Varnish to ignore are the same.
I've tried:
sub vcl_recv {
if (req.url ~ "^/fileuploader/?"
) {
return(pipe);
}
}
But it doesn't work. When trying to download a PDF through it I'm presented with a Varnish 503 Unavailable error (the same error I have if I didn't change the config). If I go through nginx directly using its port, it downloads fine.
Here's the varnishlog for this incident:
16 ObjHeader - Server: nginx/1.2.7
16 ObjHeader - Date: Wed, 17 Apr 2013 11:03:40 GMT
16 ObjHeader - Content-Type: application/pdf
16 ObjHeader - Content-Length: 1078550
16 ObjHeader - X-Powered-By: PHP/5.3.23-1~dotdeb.0
16 ObjHeader - Expires: Thu, 19 Nov 1981 08:52:00 GMT
16 ObjHeader - Set-Cookie: frontend=74go8sgckma5qrobnqc36pcjd4; expires=Wed, 17-Apr-2013 12:03:40 GMT; path=/; domain=www.site1.com; httponly
16 ObjHeader - Pragma: public
16 ObjHeader - Cache-Control: must-revalidate, post-check=0, pre-check=0
16 ObjHeader - Content-Disposition: attachment; filename=File-1338990998.pdf
16 ObjHeader - Content-Encoding: gzip
16 ObjHeader - Vary: Accept-Encoding
30 FetchError - Resource temporarily unavailable
16 FetchError - straight insufficient bytes
nginx cache varnish
I'd like that Varnish completely ignored certain URLs on my websites.
I.e., www.site1.com/fileuploader and www.site2.com/fileuploader
I have 4 websites on the same VCL, and all those websites are using the same URL structure so the only thing that changes is the domain itself, the URLs I want Varnish to ignore are the same.
I've tried:
sub vcl_recv {
if (req.url ~ "^/fileuploader/?"
) {
return(pipe);
}
}
But it doesn't work. When trying to download a PDF through it I'm presented with a Varnish 503 Unavailable error (the same error I have if I didn't change the config). If I go through nginx directly using its port, it downloads fine.
Here's the varnishlog for this incident:
16 ObjHeader - Server: nginx/1.2.7
16 ObjHeader - Date: Wed, 17 Apr 2013 11:03:40 GMT
16 ObjHeader - Content-Type: application/pdf
16 ObjHeader - Content-Length: 1078550
16 ObjHeader - X-Powered-By: PHP/5.3.23-1~dotdeb.0
16 ObjHeader - Expires: Thu, 19 Nov 1981 08:52:00 GMT
16 ObjHeader - Set-Cookie: frontend=74go8sgckma5qrobnqc36pcjd4; expires=Wed, 17-Apr-2013 12:03:40 GMT; path=/; domain=www.site1.com; httponly
16 ObjHeader - Pragma: public
16 ObjHeader - Cache-Control: must-revalidate, post-check=0, pre-check=0
16 ObjHeader - Content-Disposition: attachment; filename=File-1338990998.pdf
16 ObjHeader - Content-Encoding: gzip
16 ObjHeader - Vary: Accept-Encoding
30 FetchError - Resource temporarily unavailable
16 FetchError - straight insufficient bytes
nginx cache varnish
nginx cache varnish
edited Apr 17 '13 at 11:09
Pedro Peixoto
asked Apr 16 '13 at 13:53
Pedro PeixotoPedro Peixoto
11719
11719
bumped to the homepage by Community♦ 4 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 4 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
If you want to pass it absolutely untouched by Varnish, then the best option is return(pipe);
, which basically tells Varnish to act as a dumb TCP proxy for the duration of the connection.
But the fact that you got a 503
response seems to imply that something else is wrong - can you provide the output from varnishlog
when a request for that resource is made, if pipe mode doesn't do the trick?
Hi Shane, I've edited the OP to reflect the changes I made. If you could have a look that'd be great.
– Pedro Peixoto
Apr 17 '13 at 11:08
@PedroPeixoto It seems like pipe mode isn't occurring - where did you put that in your VCL config - is it your entirevcl_recv
? Also, you've got a literal?
in your URL config, is that needed? Try"^/fileuploader/"
instead?
– Shane Madden♦
Apr 18 '13 at 0:20
Shane, it was my entire vcl_recv indeed. I've since removed Varnish and to my biggest surprise, the websites load 40% faster. Either Varnish was misconfigured (most probably since I'm new to it), or since the disk is SSD and magento keeps most of the stuff on cache anyways, it's simply faster without Varnish. Either way I'm happy with the way it turned out, solved my problem and made the sites load faster. Thank you for your help, though. Although I don't need a solution right now, it is much appreciated.
– Pedro Peixoto
Apr 18 '13 at 9:37
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "2"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f499832%2fignore-certain-urls-on-varnish-cache%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you want to pass it absolutely untouched by Varnish, then the best option is return(pipe);
, which basically tells Varnish to act as a dumb TCP proxy for the duration of the connection.
But the fact that you got a 503
response seems to imply that something else is wrong - can you provide the output from varnishlog
when a request for that resource is made, if pipe mode doesn't do the trick?
Hi Shane, I've edited the OP to reflect the changes I made. If you could have a look that'd be great.
– Pedro Peixoto
Apr 17 '13 at 11:08
@PedroPeixoto It seems like pipe mode isn't occurring - where did you put that in your VCL config - is it your entirevcl_recv
? Also, you've got a literal?
in your URL config, is that needed? Try"^/fileuploader/"
instead?
– Shane Madden♦
Apr 18 '13 at 0:20
Shane, it was my entire vcl_recv indeed. I've since removed Varnish and to my biggest surprise, the websites load 40% faster. Either Varnish was misconfigured (most probably since I'm new to it), or since the disk is SSD and magento keeps most of the stuff on cache anyways, it's simply faster without Varnish. Either way I'm happy with the way it turned out, solved my problem and made the sites load faster. Thank you for your help, though. Although I don't need a solution right now, it is much appreciated.
– Pedro Peixoto
Apr 18 '13 at 9:37
add a comment |
If you want to pass it absolutely untouched by Varnish, then the best option is return(pipe);
, which basically tells Varnish to act as a dumb TCP proxy for the duration of the connection.
But the fact that you got a 503
response seems to imply that something else is wrong - can you provide the output from varnishlog
when a request for that resource is made, if pipe mode doesn't do the trick?
Hi Shane, I've edited the OP to reflect the changes I made. If you could have a look that'd be great.
– Pedro Peixoto
Apr 17 '13 at 11:08
@PedroPeixoto It seems like pipe mode isn't occurring - where did you put that in your VCL config - is it your entirevcl_recv
? Also, you've got a literal?
in your URL config, is that needed? Try"^/fileuploader/"
instead?
– Shane Madden♦
Apr 18 '13 at 0:20
Shane, it was my entire vcl_recv indeed. I've since removed Varnish and to my biggest surprise, the websites load 40% faster. Either Varnish was misconfigured (most probably since I'm new to it), or since the disk is SSD and magento keeps most of the stuff on cache anyways, it's simply faster without Varnish. Either way I'm happy with the way it turned out, solved my problem and made the sites load faster. Thank you for your help, though. Although I don't need a solution right now, it is much appreciated.
– Pedro Peixoto
Apr 18 '13 at 9:37
add a comment |
If you want to pass it absolutely untouched by Varnish, then the best option is return(pipe);
, which basically tells Varnish to act as a dumb TCP proxy for the duration of the connection.
But the fact that you got a 503
response seems to imply that something else is wrong - can you provide the output from varnishlog
when a request for that resource is made, if pipe mode doesn't do the trick?
If you want to pass it absolutely untouched by Varnish, then the best option is return(pipe);
, which basically tells Varnish to act as a dumb TCP proxy for the duration of the connection.
But the fact that you got a 503
response seems to imply that something else is wrong - can you provide the output from varnishlog
when a request for that resource is made, if pipe mode doesn't do the trick?
answered Apr 17 '13 at 4:55
Shane Madden♦Shane Madden
104k9145220
104k9145220
Hi Shane, I've edited the OP to reflect the changes I made. If you could have a look that'd be great.
– Pedro Peixoto
Apr 17 '13 at 11:08
@PedroPeixoto It seems like pipe mode isn't occurring - where did you put that in your VCL config - is it your entirevcl_recv
? Also, you've got a literal?
in your URL config, is that needed? Try"^/fileuploader/"
instead?
– Shane Madden♦
Apr 18 '13 at 0:20
Shane, it was my entire vcl_recv indeed. I've since removed Varnish and to my biggest surprise, the websites load 40% faster. Either Varnish was misconfigured (most probably since I'm new to it), or since the disk is SSD and magento keeps most of the stuff on cache anyways, it's simply faster without Varnish. Either way I'm happy with the way it turned out, solved my problem and made the sites load faster. Thank you for your help, though. Although I don't need a solution right now, it is much appreciated.
– Pedro Peixoto
Apr 18 '13 at 9:37
add a comment |
Hi Shane, I've edited the OP to reflect the changes I made. If you could have a look that'd be great.
– Pedro Peixoto
Apr 17 '13 at 11:08
@PedroPeixoto It seems like pipe mode isn't occurring - where did you put that in your VCL config - is it your entirevcl_recv
? Also, you've got a literal?
in your URL config, is that needed? Try"^/fileuploader/"
instead?
– Shane Madden♦
Apr 18 '13 at 0:20
Shane, it was my entire vcl_recv indeed. I've since removed Varnish and to my biggest surprise, the websites load 40% faster. Either Varnish was misconfigured (most probably since I'm new to it), or since the disk is SSD and magento keeps most of the stuff on cache anyways, it's simply faster without Varnish. Either way I'm happy with the way it turned out, solved my problem and made the sites load faster. Thank you for your help, though. Although I don't need a solution right now, it is much appreciated.
– Pedro Peixoto
Apr 18 '13 at 9:37
Hi Shane, I've edited the OP to reflect the changes I made. If you could have a look that'd be great.
– Pedro Peixoto
Apr 17 '13 at 11:08
Hi Shane, I've edited the OP to reflect the changes I made. If you could have a look that'd be great.
– Pedro Peixoto
Apr 17 '13 at 11:08
@PedroPeixoto It seems like pipe mode isn't occurring - where did you put that in your VCL config - is it your entire
vcl_recv
? Also, you've got a literal ?
in your URL config, is that needed? Try "^/fileuploader/"
instead?– Shane Madden♦
Apr 18 '13 at 0:20
@PedroPeixoto It seems like pipe mode isn't occurring - where did you put that in your VCL config - is it your entire
vcl_recv
? Also, you've got a literal ?
in your URL config, is that needed? Try "^/fileuploader/"
instead?– Shane Madden♦
Apr 18 '13 at 0:20
Shane, it was my entire vcl_recv indeed. I've since removed Varnish and to my biggest surprise, the websites load 40% faster. Either Varnish was misconfigured (most probably since I'm new to it), or since the disk is SSD and magento keeps most of the stuff on cache anyways, it's simply faster without Varnish. Either way I'm happy with the way it turned out, solved my problem and made the sites load faster. Thank you for your help, though. Although I don't need a solution right now, it is much appreciated.
– Pedro Peixoto
Apr 18 '13 at 9:37
Shane, it was my entire vcl_recv indeed. I've since removed Varnish and to my biggest surprise, the websites load 40% faster. Either Varnish was misconfigured (most probably since I'm new to it), or since the disk is SSD and magento keeps most of the stuff on cache anyways, it's simply faster without Varnish. Either way I'm happy with the way it turned out, solved my problem and made the sites load faster. Thank you for your help, though. Although I don't need a solution right now, it is much appreciated.
– Pedro Peixoto
Apr 18 '13 at 9:37
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f499832%2fignore-certain-urls-on-varnish-cache%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown