How to Install Varnish Cache on Your Nginx Server

Тәжірибелік нұсқаулар және стиль

Learn how to install a Varnish cache server on Nginx in this step-by-step tutorial that will also explain how Varnish helps to speed up your website (wether that's WordPress, WooCommerce, or something else).
Find more at tonyteaches.tech
Check out my vlog channel ‪@TonyFlorida‬
#varnish #varnishsoftware #varnishserver #varnishcache #nginx

Пікірлер: 75

  • @anubhavthakur970
    @anubhavthakur9702 жыл бұрын

    Hey Tony, thank you so much for the tutorial, your teaching is helping me a lot to accomplish my goal to become a System Administrator.

  • @TonyTeachesTech

    @TonyTeachesTech

    2 жыл бұрын

    I'm very happy to hear that! Good luck

  • @snehalsonparote8293
    @snehalsonparote8293 Жыл бұрын

    Thank you so much for this step by step configuration. I have successfully implemented it on my local.

  • @4ndreLuiz
    @4ndreLuiz2 жыл бұрын

    Good job! Thank you so much! Video quality is excellent.

  • @TonyTeachesTech

    @TonyTeachesTech

    2 жыл бұрын

    Thanks and you're welcome!

  • @mady2358
    @mady23583 жыл бұрын

    I have never saw a guy like you who will teach tech in this way basically I am from India I just love you videos and your acent . Thanks for providing this type of content in future also Love From India

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Hey thank you so much! Much more to come

  • @kozark875491
    @kozark8754913 жыл бұрын

    Super tutorial! Very illustrative! Thank you and keep goin ;)

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Thank you very much, will do!

  • @vladi189
    @vladi189 Жыл бұрын

    Great explanation!!!

  • @dawid_dahl
    @dawid_dahl3 жыл бұрын

    Great tutorial. Subbed!

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Thank you very much!

  • @sureshkadthan4702
    @sureshkadthan47022 жыл бұрын

    @Tony Teaches Tech, I am new to Varnish and learning, the way you explained is awesome, simple and easy. I have a question, let us say the varnish cache is built or we tried to warm up the cache and later on the domain name or ip changed for the website, do we have to build or rewarm the cache all over again? we are doing blue/green deployment pattern, and trying to understand when the green environment becomes blue, is there a need to rebuild the cache? Assumption here is that the green environment the varnish cache already built with load testing!!! Your input is much appreciated!!

  • @NagenderGiri
    @NagenderGiri2 жыл бұрын

    I must telll you,, you've explained it welll

  • @TonyTeachesTech

    @TonyTeachesTech

    2 жыл бұрын

    Thanks!

  • @yashpalsinghchugh5523
    @yashpalsinghchugh55233 жыл бұрын

    Hey Tony, Amazing Video. 👏🏻 Could you Make a Tutorial on setting up Reverse Proxy with Apache + Nginx + Varnish Cache Setup and Redis from Scratch. Thank You!

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Great suggestion! If I make these videos, they will probably be separate videos. Will definitely have something for you though

  • @MS-co1zj

    @MS-co1zj

    3 жыл бұрын

    @@TonyTeachesTech Is this video already out?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    @@MS-co1zj Here's a reverse proxy with Apache + Nginx video kzread.info/dash/bejne/Y5p2sLGRk7yud7Q.html which doesn't go into Varnish, but you should be able to combine the concepts from both videos to get what you're looking for :)

  • @aliriozavarce2358
    @aliriozavarce2358 Жыл бұрын

    Hey Tony. How can I automatically preload all my WP pages on the server-level every time the varnish cache is enabled and purged? Thank you.

  • @ankitbishnoi4067
    @ankitbishnoi40672 жыл бұрын

    Hi Tony, Very helpful video but How would we do in case of HTTPS, please make a tutorial which can guide us for the same...

  • @setoelkahfi
    @setoelkahfi10 ай бұрын

    Amazing! How to serve the https?

  • @DevG-zo6dl
    @DevG-zo6dl5 ай бұрын

    I Have Nginx with SSL, How to setup varnish as my nginx is running on 443 port (not 80)

  • @trollflix
    @trollflix3 жыл бұрын

    Your tutorial is amazing and very helpful. Shall we configure Nginx to accept request only from Varnish, but not anybody typing *:8080 to the url ?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Thanks! That is an option

  • @ddrci88
    @ddrci883 жыл бұрын

    Could you make one video tutorial varnish + ngnix + Apache php fhp + memcached I watch your all tutorial but all is single and different software depending

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    I can do a reverse proxy video with Apache and Nginx

  • @peakminute
    @peakminute3 жыл бұрын

    Hey, Tony, can Varnish work together with Redis?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    I don't see why not, but I haven't personally done this myself. Of course, I don't see the benefit of caching the same page, but for different pages this should work.

  • @rahilahmed2524
    @rahilahmed25243 жыл бұрын

    is there any plugin required after this installation on wordpress site? also how can I create rules for some particular pages?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    There is no plugin required for Varnish to work with Nginx, but there are some available. Here's what the official varnish folks recommend www.varnish-software.com/wiki/content/tutorials/wordpress/index.html

  • @pencilprogrammer
    @pencilprogrammer3 жыл бұрын

    cool

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    thanks

  • @atulhostdotcom
    @atulhostdotcom3 жыл бұрын

    This is actually interesting. Will it work on HTTPS sites too?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Yep definitely!

  • @anshbhatia3524
    @anshbhatia35243 жыл бұрын

    Hello Sir My magento2 website is running on ubuntu ec2 can i follow same steps for setup varnish?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    I think so, but I don't have expereince with magento2

  • @rahilahmed2524
    @rahilahmed25243 жыл бұрын

    Can I control Varnish, the way cloudways or other hosting services control, to stop varnish and to restart varnish whenever required?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Technically yes, with one of systemctl start/restart/stop varnish

  • @ddrci88
    @ddrci883 жыл бұрын

    Do you think varnish and redis will much faster work together under the Ubuntu ? I’m thinking to do lemp reverse proxy varnish and redis cache 😂

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    In some cases, redis and varnish will works wonders. A LEMP server with redis and varnish sounds like a good stack to try

  • @ddrci88
    @ddrci883 жыл бұрын

    Let’s make another episode :) install memcached and redis

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Added it to the list!

  • @dimuviranga7770
    @dimuviranga77702 жыл бұрын

    I'm trying to develop a adaptive bit-rate VOD streaming. In this case caching can't do by traditional way using nginx. Because the user request change dynamically and according to that streaming content will change. Is there a way to develop such kind of caching for the adaptive bit rate VOD streaming?

  • @dimuviranga7770

    @dimuviranga7770

    2 жыл бұрын

    If you can provide any reference, it will really helpful for me

  • @TonyTeachesTech

    @TonyTeachesTech

    2 жыл бұрын

    I'm not sure. Good luck

  • @sachintiwari2289
    @sachintiwari22893 жыл бұрын

    Can I use varnish with redis as well?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Yes, as long as they are being used for different purposes i.e. not caching the same objects

  • @bryanmendez1992
    @bryanmendez19923 жыл бұрын

    Hello, I tried to change port 8080 to 443, but I have not been successful, you could make an example with 443, thanks

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    What kind of behavior/error do you see with 443?

  • @bryanmendez1992

    @bryanmendez1992

    Жыл бұрын

    @@TonyTeachesTech Hello, I tried to make a proxy_pass where I reference port 80 but I can't get it to go through varnish

  • @lovekeshkumar4007
    @lovekeshkumar40073 жыл бұрын

    Can you do it over https? When trying with https things are not working.:(

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    Yes https should work too

  • @home-uf3tg
    @home-uf3tg3 жыл бұрын

    Nginx is already have caching feature. do we really need Varnish? What Vanish caching provides additionally?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    In some situations, caching with Varnish might be more favorable to Nginx caching

  • @birdbrainsolutions6112

    @birdbrainsolutions6112

    3 жыл бұрын

    @@TonyTeachesTech Can you use varnish with nginx caching?

  • @TonyFlorida

    @TonyFlorida

    3 жыл бұрын

    @@birdbrainsolutions6112 yes, but any given piece of content can only be served from one cache store

  • @birdbrainsolutions6112

    @birdbrainsolutions6112

    3 жыл бұрын

    @@TonyFlorida Which one would you choose? If only one works I would prefer nginx, because I use Plesk. Unless you recommend Varnish btw, thanks for creating all the videos :)

  • @AhsenHusnan
    @AhsenHusnan3 жыл бұрын

    bro in my case my nginx is running on 443 how i can mange it with varnish port plz elaborate it

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    No worries, just replace 8080 with 443 in the tutorial video

  • @wnywebdevelopment8757

    @wnywebdevelopment8757

    3 жыл бұрын

    @@TonyTeachesTech Varnish doesn't even show up in the netstat list when trying to do this for https on port 443. Why would you do a video of installing varnish on a non-secure port? Who doesn't use https?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    @@wnywebdevelopment8757 use the port that meets your needs

  • @theviralonly112
    @theviralonly1122 жыл бұрын

    what about the ssl how we can install ssl ?

  • @TonyTeachesTech

    @TonyTeachesTech

    2 жыл бұрын

    Here you go kzread.info/dash/bejne/mZyOuqiyedyxYdI.html

  • @AkashBiswas-nd4qd
    @AkashBiswas-nd4qdАй бұрын

    but ssl wordpress site is nor working

  • @anilgaur2324
    @anilgaur2324 Жыл бұрын

    Hi can you send me installation commands please

  • @ddrci88
    @ddrci883 жыл бұрын

    how to close apache port 8080 :D

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    sudo ufw deny 8080

  • @jitx2797
    @jitx27973 жыл бұрын

    Varnish and Redis do different things? Why people in comment section talking about using them both?

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    :)

  • @maxeneterremetis3033
    @maxeneterremetis30333 жыл бұрын

    I’m getting Error 503 Backend Fetch Failed 😞

  • @TonyTeachesTech

    @TonyTeachesTech

    3 жыл бұрын

    That's a new one for me :) No suggestions are jumping out at me in my brief research

  • @maxeneterremetis3033

    @maxeneterremetis3033

    3 жыл бұрын

    @@TonyTeachesTech yeah, I think I figured it out. I had seed pro coming soon plug-in installed in all of my sub domains. Varnish doesn’t like certain plug-ins. That’s what I’ve read. Will re-install

  • @shanmugasundaram6625
    @shanmugasundaram66255 ай бұрын

    you are already root.. why do you want to add sudo? lol

  • @AlirezaMirhabibi
    @AlirezaMirhabibi2 ай бұрын

    Thank you so much. I installed varnish on my server using this tutorial, but I have a question. Is there any administrator on 127.0.0.1:6082 for varnish ? I added sub vcl_recv { set req.http.Authorization = "Basic d2h5ZGlkeW91OmRlY29kZXRoaXM="; } You can set base64 username password using below command echo -n "username:password" | base64 on default .vcl but when is open 127.0.0.1:6082 on my explorer nothing happened.