Hello everyone! Has been a long time since I last posted here, but hey! as they say better late than never! As many of you can imagine, based on my content, I’ve always been a homelab enthusiast, and the last addition to my homelab was a DGX Spark from Nvidia. I remember since the first time I saw a computer the first thing that came to my mind was: How can I make something like this? How does…
Hello everyone, long time no see! Today while working on a PR, I was thinking about how to do CORS without using ifs on NGINX. If you are not familiar with the reasons to try to avoid using IF, you should take a look at this post And as usual, map comes at our rescue! Sadly, I could not remove all IFs from the configuration as I required to use return 204 for the HTTP method OPTIONS. # Origin…
Hello everyone! Today, for a change, I will be talking about Consul from Hashicorp instead of NGINX. I will start with the assumption that you’re aware of what a DNS round robin is and how it’s supposed to work and evolve from there. I would like to start saying that the “problem” we faced, it’s not related to Consul, but the solution that we looked for was for Consul. Today Rafael while…
Today I would like to show how two NGINX+ modules can work together to create a replicated and load balanced RESTfull key-value storage. If you have any question, not only about NGINX, that you think that I can answer for you, feel free to leave a comment! I’ve been monitoring NGINX questions on Twitter, but let’s say that people have a really bad time asking questions, especially when they have a…
One of the biggest challenges for content caching is the expiration of this content, too short lived and your cache is not effective, too long, and you will serve stale data. The sweet spot for caching is exactly to cache the content while it’s valid, which is hard as you may not know for how long your content will be valid at the moment that’s being cached. To help with that NGINX+ has a cache…
A really useful information to have while debugging applications is an end-to-end request id. To be able to achieve that you need not only NGINX but also application changes, to forward the ids but also to log them. On this post, I would like to share how to implement the NGINX side. One way to achieve that is setting a header for both the client side and to the upstream called X-Request-ID for…
After a long winter, I’m here again to post about my favorite subject, wanna guess? NGINX! (Like it was hard to guess) I will start with a story, which may or may not be based in real life, you get to choose. Once upon the time, Mr. J worked in a big company that used NGINX as their caching layer. As the company grew, so their infrastructure, and now they needed to run multiple NGINXs (What’s the…
Hello, everyone! Time to get back to our series of posts about NGINX! This time, let’s talk about an old friend, the proxy_cache_bypass command, which we used multiple times in my examples, but I never dedicated a post to it, so it’s time to fix this error! At first glimpse, proxy_cache_bypass feels like a simple command, one where you can bypass caching when necessary, but after reading the…
Hello friends, For the ones of you that do not know imapfilter, you should check it out, but basically, imapfilter is an IMAP client where you can write a set of rules and apply this rules to your mailbox. imapfilter rules are written in Lua, a really simple and powerful programming language. To start you should create a folder in your home directory called imapfilter, to do so you use the…
I don’t think this is thinking outside the box, but I could not do a series of posts about useful commands without talking about map , arguably one of the most useful commands on NGINX, especially that I’m sure map will be used in most of our posts. You should think about map as a “switch” statement like many programming languages have, it’s how you will be able to take advantage of it. Basically,…