Does Plesk support Varnish?

Follow

Comments

16 comments

  • Avatar
    Michel vd Lingen

    A tutorial that is over 4 years old. How about really creating a good (and new) tutorial for Varnish 6.x?

    There are a lot of requests and mostly they are made by people who understand the power of Varnish. It's way better than Apache + Nginx. Especially considering software like Wordpress and Magento are becoming more and more heavy. With Varnish Plesk could make a leap forward.

    Recently more and more nonsense are added to Plesk. Why not take your users seriously and simply add Varnish support? So either give us an updates (and good) tutorial for Varnish 6.x or simply add Varnish support to Plesk. After 4 years something needs to be done imho!

    Also I see almost 700 feature votes for Varnish on Plesk User Voice, but still nothing. I have seen "useless" stuff (sorry to say) being added with far less votes. So make Plesk (much) better and add Varnish or at least update the tutorial for it...

    Plesk is starting to run behind (especially since it's considered a premium product, with a premium price). DirectAdmin is really catching up. Heck, you can install and get Varnish working on DirectAdmin within 5 minutes. And it only takes a few lines of code. So terribly disappointing that Plesk cannot do this; that or they are simply unwilling...

    2
    Comment actions Permalink
  • Avatar
    Leonid Gukhman

    Hi Michel vd Lingen, we have updated the article, adding the SEO-safe HTTP to HTTPS redirect for WordPress.

    1
    Comment actions Permalink
  • Avatar
    Stefan Yakubov

    Hello, Michel vd Lingen

    Commands and the whole scenario were tested a number of times in both RedHat and Debian-based OS. As you've confirmed it also worked in your environment as well, eventually.

    Please, check if all the steps are followed correctly. Otherwise, if there is a specific use case that prevents some steps from executing properly under certain circumstances, please let me know, so I'll be able to improve the article with additional information.

    0
    Comment actions Permalink
  • Avatar
    Michel vd Lingen

    Thank you for the updated tutorial!

    0
    Comment actions Permalink
  • Avatar
    Michel vd Lingen (Edited )

    Leonid Gukhman

    I finally had some time for this, thank you for the updated tutorial.
    However it doesn't work for me. Probably doing something wrong.

    First; I got an internal server error (nginx) and apparently the Varnish (in Docker) died? So I restarted it there.
    Now I am getting:

    Error 503 Backend fetch failed

    Backend fetch failed

    Guru Meditation:

    XID: 24

    Will test a few things more in the meantime.

    Okay after rebooting the server I am getting again the first error:

    502 Bad Gateway


    nginx


    Seems Varnish died again :S

    Debug: Version: varnish-7.0.0 revision 454733b82a3279a1603516b4f0a07f8bad4bcd55
    Debug: Platform: Linux,3.10.0,x86_64,-junix,-smalloc,-sdefault,-hcritbit
    Debug: Child (20) Started
    Info: Child (20) said Child starts
    Error: Manager got SIGTERM
    Debug: Stopping Child
    Info: Child (20) ended
    Info: Child (20) said Child dies
    Debug: Child cleanup complete
    Info: manager stopping child
    Info: manager dies


    I guess this shouldn't happen, right?
    I will check more in the meantime (when I have some spare time).

    0
    Comment actions Permalink
  • Avatar
    Farhad Pezeshki (Edited )

    Hi Stefan,
    I have installed Varnish with this configuration and it works quite well.
    I have a problem with a WordPress plugin called "Frontend Reset Password" that I have to reset Varnish every few days to make it work properly. In forntend of website I recieve this error: "ERROR: Something went wrong with that!"
    I have seen that indeed the problem comes from Varnish.
    How can I solve this problem?

    Thank you

    0
    Comment actions Permalink
  • Avatar
    Michel vd Lingen

    Bump!!

    0
    Comment actions Permalink
  • Avatar
    Poonyalid Penpargkul

    I need Varnish Cache on Plesk for Windows.

    0
    Comment actions Permalink
  • Avatar
    Sami CHANGUEL (Edited )

    Thank you for the tutorial.

    Are there extra steps for Multi-site version of Wordpress ? I've flowed all the steps, added the "Additional directives for HTTP" to only one of the network's domains (so I can check) : It falls into a loop redirect !

    I've followed all the comments of Michel vd Lingen  : server reboot, the content of /etc/varnish/default.vcl inside the container was good ... but nothing works :(

    In proxy_access_ssl_log there are only 301 requests :

    88.my.ip.232 - - [10/Dec/2021:11:12:51 +0000] "GET / HTTP/2.0" 301 227 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0"

    The proxy_error_log file is empty !

    0
    Comment actions Permalink
  • Avatar
    Farhad Pezeshki

    Hi Stefan,
    Thank you for your reply.
    Unfortunately, it is a free plugin and I have not received an answer from its author.
    I have read on the Internet that most of the plugins that use password reset like Woo-commerce have problems with Varnish. I don't know if disabling varnish caching for a specific URL would work because most of these plugins also use cookies.
    Anyway I would like to try disable URL caching. Is there an online tutorial on how to do this?

    Thanks

    0
    Comment actions Permalink
  • Avatar
    Michel vd Lingen (Edited )

    Apparently more people have had these issues given the amount of (older) comments on the blog article from Plesk. :S
    See: https://www.plesk.com/blog/product-technology/varnish-wordpress-docker-container/#comment-97932
    (and below)

    So I am not the only one. ;-)

    Also this was the exact same issue I also had with the old blog article with the old Varnish version. I thought these issues would have been resolved with an updated blog article. I guess not. :S

     

    Okay, an update. Apparently the commands from the blog (and here) do not work:

    docker ps | grep varnish | awk {'print $1'} | xargs -i docker exec -t {} sed -i '/.port/c\ .port = "7080";' /etc/varnish/default.vcl

    docker ps | grep varnish | awk {'print $1'} | xargs -i docker exec -t {} sed -i '/.host/c\ .host = "203.0.113.2";' /etc/varnish/default.vcl

    As I just checked the Varnish configuration within Docker and it still shows:


    # Default backend definition. Set this to point to your content server.
    backend default {
    .host = "127.0.0.1";
    .port = "8080";
    }


    No wonder that this does not work... After changing it when logged in Docker it seems to work.

    0
    Comment actions Permalink
  • Avatar
    Michel vd Lingen (Edited )

    Okay, I gave it one more try by rebooting the complete server. Seems that helped?
    So probably something off with the commands for restarting Docker?


    Seems to be working now as expected:

    1. server:
      nginx
    2. vary:
      Accept-Encoding
    3.  
      via:
      1.1 varnish (Varnish/7.0)
    4. x-cache:
      HIT
    5. x-powered-by:
      PleskLin
    6. x-varnish:
      23 32774

    But maybe re-check the tutorial?

    0
    Comment actions Permalink
  • Avatar
    Michel vd Lingen (Edited )

    And another bump.
    Bump for V-A-R-N-I-S-H!

    0
    Comment actions Permalink
  • Avatar
    Michel vd Lingen

    Also having issues with the 2nd part (for Wordpress).

    I disabled: Permanent SEO-safe 301 redirect from HTTP to HTTPS
    I enabled: SSL/TLS support
    I added the "Additional directives for HTTP"-stuff

    And yes, I downloaded the modified .vcl file and changed it to my IP.
    When I open the page I am getting an error in Dutch (Website is forwarding correctly or something) in Firefox. In Chrome something similar but also with the error: ERR_TOO_MANY_REDIRECTS

    I do not have a .htaccess file. I have no clue where to look, but I think the current manual is not that good. Seems it has quite a few flaws and a lot "if's".
    Anyways, I am done with this for today....

    0
    Comment actions Permalink
  • Avatar
    Stefan Yakubov

    Hi, Farhad Pezeshki, considering that the 3rd party plugin is in use, I'd recommend you check with its community/devs, on how to run it properly with varnish cache.

    Alternatively, if a specific URL is in use, you can disable the varnish caching feature for such URLs by modifying the varnish config file - default.vcl

    0
    Comment actions Permalink
  • Avatar
    Michel vd Lingen

    Bumping this thread as a reminder to take some action.

    0
    Comment actions Permalink

Please sign in to leave a comment.

Have more questions? Submit a request