Author Topic: I am not sure if Varnish is working or not.  (Read 1484 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
I am not sure if Varnish is working or not.
« on: February 16, 2023, 03:24:06 AM »
Hello,

I would like to ask for help, regarding Varnish.

Whenever I use this method:

Code: [Select]
HTTP: Nginx (80) --> Varnish (82) --> Apache (8181)
HTTPS: Nginx (443) --> Varnish (82) --> Apache (8181)

And follow and use this article; I see randomly generated numbers every time I refresh it.

So, what I did is use this instead,

Code: [Select]
HTTP: Nginx (80) --> Varnish (82)
HTTPS: Nginx (443) --> Varnish (82)

However, it seems that I always receive an error saying:

Code: [Select]
Error 503 Backend fetch failed
I don't understand why. I tried using a Custom Configuration per domain, yet it still does not work.

May you please help me out?

Thanks.

Offline
*
Re: I am not sure if Varnish is working or not.
« Reply #1 on: February 16, 2023, 05:02:43 AM »
Hello,

I would like to ask for help, regarding Varnish.

Whenever I use this method:

Code: [Select]
HTTP: Nginx (80) --> Varnish (82) --> Apache (8181)
HTTPS: Nginx (443) --> Varnish (82) --> Apache (8181)

And follow and use this article; I see randomly generated numbers every time I refresh it.

So, what I did is use this instead,

Code: [Select]
HTTP: Nginx (80) --> Varnish (82)
HTTPS: Nginx (443) --> Varnish (82)

However, it seems that I always receive an error saying:

Code: [Select]
Error 503 Backend fetch failed
I don't understand why. I tried using a Custom Configuration per domain, yet it still does not work.

May you please help me out?

Thanks.

This is the article that I am talking about: https://wiki.centos-webpanel.com/varnish-cache-test
« Last Edit: March 11, 2023, 08:04:31 PM by Alnork »

Offline
****
Re: I am not sure if Varnish is working or not.
« Reply #2 on: March 11, 2023, 04:43:09 PM »
Did you look at the HTTP headers in the source view?

Quote
The X-Varnish HTTP header allows you to find the correct log-entries for the transaction. For a cache hit, X-Varnish will contain both the ID of the current request and the ID of the request that populated the cache. It makes debugging Varnish a lot easier.