Reverse Proxy and Automatic SSL for Free with Open Source Caddy!

Поділитися
Вставка
  • Опубліковано 3 гру 2024

КОМЕНТАРІ • 94

  • @Pearlygatesbouncer
    @Pearlygatesbouncer 3 роки тому +10

    I have absolutely no idea how I got here or what is going on

  • @mecamon
    @mecamon 2 роки тому

    Dear lord! This is a life savior web server. Came to this video after spending like 4 hours trying to set up SSL with Nginx.

    • @shawnp0wers
      @shawnp0wers  2 роки тому +1

      I made this video shortly after I first learned about Caddy -- that was 2 years ago, and I've never gone back. It's just so SO simple.

  • @GameON-Playstation
    @GameON-Playstation Рік тому

    Short, easy to follow and straight to the point. Good job

  • @siavongaboy
    @siavongaboy 4 роки тому +3

    Thank you for explaining everything so simply and with great energy! This video is extremely under viewed and under liked.
    I will set up caddy in Docker and keep it simple, I got to deep into technical setups with rancher, kubernettes and traefik but this looks much easier and more in line with my needs.

    • @shawnp0wers
      @shawnp0wers  4 роки тому

      Thanks Maurice! I appreciate that. And yeah, it makes managing docker apps just like other apps on the system. I find it super easy.

  • @abdirahmann
    @abdirahmann 2 роки тому +1

    🤣🤣 The bloopers... am dead!! and btw... i use traefik as a reverse proxy just because it was the first i learnt how to use when i was playing with my little homelab. though such a steap learning curve. i love it because of its technicalities, i am SHOCKED by how simple caddy is!!, just wOw!. Thanks for the video.

    • @abdirahmann
      @abdirahmann 2 роки тому

      and btw... there is this product called authelia i use. its an authentiaction server that works with reverse proxies, its fully supported in traefik, nginx and HA-proxy but not caddy. That's also a reason am not using it but honestly... it's soooooooo simple am blown away by how fast that caddy setup was!.

    • @shawnp0wers
      @shawnp0wers  2 роки тому

      Interesting, i haven't heard of authelia before. Bummer it doesnt' work with Caddy. Because yeah, while I dont' know that it's any better than the other options, it sure is simple. Sorta like me. :D

    • @abdirahmann
      @abdirahmann 2 роки тому

      @@shawnp0wers 🤣🤣 i agree you are a simple man.

    • @noweare1
      @noweare1 Рік тому

      @@abdirahmann Caddy has its own "basicauth" or there are auth plugins you can use.

  • @MichaelSharpTechniSmart
    @MichaelSharpTechniSmart Рік тому

    Wow, I have been missing out. Now 'm subscribed!

    • @shawnp0wers
      @shawnp0wers  Рік тому

      NOICE! Welcome welcome welcome. :)

  • @rhysdenno5993
    @rhysdenno5993 3 роки тому +1

    Does this not work for remote access?

  • @m_205
    @m_205 2 роки тому

    Hello,
    Caddy does everything under the hood ,
    Can you give some general idea how can I do the same with nginx.

  • @Lightcode777
    @Lightcode777 Рік тому

    easy to fallow! thank you so much for the content you provide !!! :)

  • @eeee3202
    @eeee3202 4 роки тому +1

    This doesn't work for me. I can install caddy but then i go to bw."TLD".com and it doesnt resolve. Are we suppose to do anything there?

    • @shawnp0wers
      @shawnp0wers  4 роки тому

      The DNS has to be set up apart from Caddy. Make sure the domain name resolves to the IP of your server. (Or to your external IP address and your router port forwards into your caddy server)

  • @dragon3602010
    @dragon3602010 3 роки тому +1

    What is the difference with traefik and nginx proxy manager ?

    • @shawnp0wers
      @shawnp0wers  2 роки тому +1

      I'm so sorry I missed this, and I'm 1000% sure you're not still wondering. I'll answer in case someone else sees your question and wonders.
      They can both do the exact same thing. Traefik can be simpler, and a little more confusing at first to set up (IMHO) -- Nginx requires a little more ongoing maintenance, but is slightly easier to understand out of the box, and can do more complicated things if you need it to. (Again, IMHO)
      Both can do the job, both are powerful. If one is working well for you, there's probably no need to switch, unless you just want to learn how the other works.

  • @bala-st9cj
    @bala-st9cj 3 роки тому +1

    Thank you so much ,What a man.you made me a caddy lover

    • @shawnp0wers
      @shawnp0wers  2 роки тому +1

      So glad! I still use it so often. :)

  • @anuswadh
    @anuswadh 3 роки тому

    Thank you Shawn. Works like a charm

  • @Eldrazer
    @Eldrazer 2 роки тому

    I can't edit /etc/caddy/Caddyfile, it says this file is unwritable. Any help?

    • @shawnp0wers
      @shawnp0wers  2 роки тому

      Sorry for the late reply, I've been really sick -- you might need to "sudo" in order to edit the file with root privilege. I think the file is owned by root, so without sudo, you won't be able to write to it...

  • @jame_sta
    @jame_sta 3 роки тому +1

    You have any more videos on Caddy 2?
    Subbed and liked :)

    • @shawnp0wers
      @shawnp0wers  3 роки тому +2

      Not yet, but I keep using it more and more.

  • @XaYaZaZa
    @XaYaZaZa 3 роки тому +1

    OMG this looks so helpful!!!! THX!

  • @tylersustare
    @tylersustare 3 роки тому

    This was amazing. Thanks Shawn!

  • @tunlinaung010
    @tunlinaung010 3 роки тому

    You are the best teacher for me thanks

  • @dailymeow3283
    @dailymeow3283 3 роки тому

    Hey Shawn, how can i install caddy on windows, i have node project and docker got issues with node on windows

    • @shawnp0wers
      @shawnp0wers  3 роки тому +1

      I don’t actually know - I’d check out their website to see.

  • @belaircomputerguyllc4001
    @belaircomputerguyllc4001 3 роки тому

    Absolutely excellent channel. SOLID and CLEAR explanations. Are you still using Caddy?

    • @shawnp0wers
      @shawnp0wers  3 роки тому

      Aww, thanks! Yes - I still LOVE caddy.

  • @JordanRolph
    @JordanRolph 3 роки тому

    Really helpful, thanks Shawn!

  • @jacobnoori
    @jacobnoori 2 роки тому

    This was so easy! Thank you!

  • @theboomingbomber
    @theboomingbomber Рік тому

    Thank you for explaining soo well

  • @miguelfonseca1980
    @miguelfonseca1980 10 місяців тому

    Thank you very much , I got my dns working with https now :)
    I don't klnow if anyone used immich before , I'm not able to redirect to the web page , can you try to help me please ?
    Thank you in advance

  • @joegessner6837
    @joegessner6837 3 роки тому +1

    Had been trying to set up Caddy in docker for a while with Duckdns and the challenges always failed. I used your video as guide and was finally able to get it working outside of docker. Only issue I had was it was trying to connect to my router instead of the docker container, I added :443 to the domain name in the caddy file and was finally able to reach the container. Much thanks sir.

  • @adamsuail
    @adamsuail 2 роки тому +1

    How come I never saw you before 😂, more of those vids please 🙏

    • @shawnp0wers
      @shawnp0wers  2 роки тому +1

      I plan on releasing regular content in 2022, please stick around and help me decide what topics to cover! :)

  • @NyneIX9
    @NyneIX9 3 роки тому

    If I already enabled remote access for Plex, will Caddy interfere with this? 🤔
    Excellent video, by the way!

    • @shawnp0wers
      @shawnp0wers  2 роки тому +1

      Ugh, sorry I missed this -- no, plex should use a different port.

    • @NyneIX9
      @NyneIX9 2 роки тому

      @@shawnp0wers Hey! Much appreciated! Better late than never, I always say. There are other UA-camrs of your size that just don't respond at all.

    • @shawnp0wers
      @shawnp0wers  2 роки тому

      @@NyneIX9 That's incredibly kind, thank you. :)

  • @jokorusbiyanto
    @jokorusbiyanto 4 роки тому

    Hi Shawn,,, nice video. Can it be used for nginx as reverse proxy?

    • @shawnp0wers
      @shawnp0wers  4 роки тому +2

      Yes! That’s what I was using before, but Caddy has an even smaller footprint, and configuration is simpler. It has a ton of modules for more complex needs, but out of the box I’m using it on 10-15 sites and apps.

  • @MarcioBrenerCosta
    @MarcioBrenerCosta 11 місяців тому

    Congrats by the video. It's realy great😊

  • @Clone9673
    @Clone9673 Рік тому

    Thank you very much. This is very helpful.

  • @nicksgarage8295
    @nicksgarage8295 2 роки тому

    this is great. i got some esxi vm's that have some websites that run lots of compute i need to serve and i aint gonna be paying aws an arm and a leg.

    • @shawnp0wers
      @shawnp0wers  2 роки тому

      Sweet! It's been a long time, and this still works so well it's creepy. Seriously like zero maintenance. :)

  • @vikramkumar8276
    @vikramkumar8276 4 роки тому

    Hi sir wonderful video 👌 ..I like this and also expecting more tips like this on your channel👑

    • @shawnp0wers
      @shawnp0wers  4 роки тому +2

      Thanks Vikram! I'm trying to decide what the best "day of the week" to release tech tips might be. But I'm going to keep posting them, for sure!

  •  4 роки тому +1

    Amazing content. As a follow up, maybe you could guide us through an example of more than one reverse proxy!

    • @shawnp0wers
      @shawnp0wers  4 роки тому +1

      Hi Victor. :)
      I might do that -- but honestly, it's just a matter of putting the info inside curly braces. So you have a domain, info about that domain inside curly braces, then another domain, and another set of curly braces for that domain, etc, etc.

    •  4 роки тому

      @@shawnp0wers It's true! I noticed that shortly after commenting! Caddy is amazing and super easy!

  • @ddrci88
    @ddrci88 2 роки тому

    Hey Shawn, can you make caddy reverse proxy to apache tutorial?

    • @shawnp0wers
      @shawnp0wers  2 роки тому +1

      So, the process is largely the same, but there's a problem if they're running on the same machine.
      By default, Caddy listens on both port 80 and port 443. If you have Apache on the same server, it will try to listen on port 80 (by default at least). If you have Apache on a different machine, or different VM (or listening on a different port), you could set it up to proxy to the non-SSL apache port.
      If you have apache use a different port on the same machine, you'd just set Caddy to proxy to localhost:THAT_NEW_PORT -- or if it's on another machine/VM/or_IP, you'd have Caddy point to other_internal_IP:80
      Does that help?

    • @ddrci88
      @ddrci88 2 роки тому

      @@shawnp0wers thanks a lot. I’m looking for a new stack now :) I wa saying Nginx reverse to Apache. Want to try out candy to Apache

    • @shawnp0wers
      @shawnp0wers  2 роки тому +1

      @@ddrci88 No problem! I really like Caddy for its simplicity and automatic certificate handling.
      I've struggled to get Wordpress to work behind a reverse proxy of any sort though. It really wants to run in SSL mode, but having another machine do the SSL part seems to cause a lot of trouble. I'll probably play with it more at some point, but right now, I have my Wordpress installs running on another server. :/

    • @noweare1
      @noweare1 Рік тому

      @@shawnp0wers You can also change the default ports for caddy. You put it in the global variable section of your Caddyfile ie. http_port 8080 https_port 4430 if you want to use some other ports

  • @Gh0stRec0n313
    @Gh0stRec0n313 3 роки тому

    do you need to open ports to get the ssl certificate?

    • @shawnp0wers
      @shawnp0wers  3 роки тому

      It uses ports 80 & 443. 80 is redirected to 443, but it’s also used to renew certs.

  • @OmgLuLzWTF
    @OmgLuLzWTF 3 роки тому

    ok searching for nginx proxy server and openmediavault got me here.. I think I need to switch to caddy

    • @shawnp0wers
      @shawnp0wers  3 роки тому

      That was my path to caddy too! :)

    • @OmgLuLzWTF
      @OmgLuLzWTF 3 роки тому

      @@shawnp0wers one question since I think this works the same as the one in openmediavault. since something is already using port 80/443, you can't really point your main domain to something internally and you need to use subdomains. Is my understanding correct?

    • @shawnp0wers
      @shawnp0wers  3 роки тому

      I point everything to caddy, and then forward into different servers/services based on DNS names. I’m not familiar with openmediavault, but caddy will forward to internal SSL ports as well. You can even force it to accept internal self-signed SSL. (I try to run everything unencrypted internally though, and have caddy handle all the certs)
      Honestly though, Wordpress has given me fits. I’m hosting directly via caddy/PHP for it instead of forwarding to another server.

    • @OmgLuLzWTF
      @OmgLuLzWTF 3 роки тому

      @@shawnp0wers Thanks.. I might test this out tomorrow. You sir earned a sub
      As for wordpress, it doesn't like ports for some reason. Happened to me a few times before when I was stilling using it. I moved on to static webpages uses less resources, no database, easier to back up just copy and paste

  • @thehandofjibreel8756
    @thehandofjibreel8756 4 роки тому

    I like your energy. Cool video :-)
    Please, I have a question: How do you reverse-proxy two subdomains to a local domain with two different ports?
    user.example.com -----> localhost:4000
    admin.example.com -----> localhost:4001
    I'm not interested in load balancing, in this case, just reverse proxy.
    Just subscribed by the way!

    • @shawnp0wers
      @shawnp0wers  4 роки тому

      Thanks! Here's a copy/pasta of the comment I made on a similar question one of my other recent videos:
      The Brain of Shawn
      • 5 days ago
      Yes! Mine looks something like this:
      site1.domain.com
      {
      reverse_proxy internet.ip.address:port
      }
      site2.domain.com, alias.domain.com
      {
      root * /var/www/mysql
      file_server
      encode gzip
      php_fastcgi unix//run/php/php7.2-fpm.sock
      }

    • @shawnp0wers
      @shawnp0wers  4 роки тому

      That example is one reverse proxy and one standard website, but each "stanza" can be a reverse proxy. As long as the domain resolves to the IP of the caddy server, it should match up the correct info in your Caddyfile.

  • @shivanshsharma7422
    @shivanshsharma7422 Рік тому

    AWESOME

    • @shawnp0wers
      @shawnp0wers  Рік тому

      I still love Caddy. Use it for everything these days!

  • @saurabhjain8904
    @saurabhjain8904 Рік тому

    Its not working

    • @shawnp0wers
      @shawnp0wers  Рік тому

      I’m not sure what you mean, but my infrastructure was offline when I woke up this morning and I just got things going. (Power surge overnight from the power company)

    • @saurabhjain8904
      @saurabhjain8904 Рік тому

      @@shawnp0wers I mean I did all the steps but caddy status shows failed

    • @shawnp0wers
      @shawnp0wers  Рік тому

      @@saurabhjain8904 hmm... I'd check permissions, or see if you can find any details in the logs to see what's going wrong. (probably in /var/log/caddy*)

    • @noweare1
      @noweare1 Рік тому

      You have to port forward 80 and 443 in your router. Did you do that ?

  • @jamallmahmoudi9481
    @jamallmahmoudi9481 2 роки тому

    Hi, cool&perfect

  • @sayanmdn
    @sayanmdn 3 роки тому

    nice

  • @bbrendon
    @bbrendon Рік тому

    this guy doesn't follow best practices at all.

    • @shawnp0wers
      @shawnp0wers  Рік тому

      I wash my hands after using the bathroom... And signal when changing lanes. So I follow *some* best practices. ;)