<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Nginx on Ali's Engineering Notes</title><link>https://muhammadalics.github.io/tags/nginx/</link><description>Recent content in Nginx on Ali's Engineering Notes</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 06 Oct 2026 18:39:57 -0600</lastBuildDate><atom:link href="https://muhammadalics.github.io/tags/nginx/index.xml" rel="self" type="application/rss+xml"/><item><title>Server-Side Caching Explained: Cache Hit, Miss, and Expiry</title><link>https://muhammadalics.github.io/posts/serverside-cache/</link><pubDate>Tue, 06 Oct 2026 18:39:57 -0600</pubDate><guid>https://muhammadalics.github.io/posts/serverside-cache/</guid><description>&lt;p&gt;Server side caching can be implemented via reverse proxy such as nginx. Caching allows the traffic to be served faster and also reduces the load on the app. In this post, I am going to demonstrate the server-side caching using a server and an nginx reverse proxy running locally.&lt;/p&gt;
&lt;p&gt;Lets talk about what cache miss and cache hit mean.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cache Miss&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This is when a reverse proxy receives a request and can&amp;rsquo;t find the response in the cache. In such cases, the request is forwarded to the origin server and reverse proxy stores the response in cache.&lt;/p&gt;</description></item><item><title>Nginx Rate Limiting in Action</title><link>https://muhammadalics.github.io/posts/rate-limit/</link><pubDate>Sun, 04 Oct 2026 11:45:13 -0600</pubDate><guid>https://muhammadalics.github.io/posts/rate-limit/</guid><description>&lt;p&gt;Rate limiting an API is required for several reasons.&lt;/p&gt;
&lt;p&gt;A single service serves calls from many clients. We want to make sure that the calls from clients are served fairly and one client doesn&amp;rsquo;t consume all the app resources. Too many requests in a short period of time can overwhelm the service by consuming too much CPU or memory. Another reason why we might want to limit a client is when they used up all their allocated credits.&lt;/p&gt;</description></item><item><title>Canary Deployments, Weighted Round Robin and Stickiness</title><link>https://muhammadalics.github.io/posts/canary/</link><pubDate>Thu, 01 Oct 2026 23:10:03 -0600</pubDate><guid>https://muhammadalics.github.io/posts/canary/</guid><description>&lt;p&gt;Lets test a canary deployment using nginx weighted round robin strategy. Canary deployment is a pattern where a new version of a service is rolled out to a subset of users to make sure that the new version works as intended.&lt;/p&gt;
&lt;p&gt;Lets say we have an exisiting deployment and we would like to route about 20% of the requests to a canary while the existing deployment gets 80% of the requests. We can specify the weights in the nginx reverse proxy config. See highlighted lines below.&lt;/p&gt;</description></item><item><title>Round Robin with nginx</title><link>https://muhammadalics.github.io/posts/nginx-round-robin/</link><pubDate>Tue, 29 Sep 2026 21:35:44 -0600</pubDate><guid>https://muhammadalics.github.io/posts/nginx-round-robin/</guid><description>&lt;p&gt;This is a simple demo of a round robin reverse proxy. Round robin is a fundamental concept in system design. I will show how this concept can be demonstrated locally.&lt;/p&gt;
&lt;p&gt;I am going to create three http servers locally on Ubuntu. I will then put nginx reverse proxy in front of the servers and we will see how the reverse proxy routes the traffic.&lt;/p&gt;
&lt;p&gt;Lets fire up a terminal multiplexer. We will have four sessions here. I will run three servers in three separate panes&lt;/p&gt;</description></item></channel></rss>