<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged number</title>
<link>https://coderlegion.com/tag/number</link>
<description>Powered by Question2Answer</description>
<item>
<title>How Nginx Architecture is Designed and How They Work</title>
<link>https://coderlegion.com/14073/how-nginx-architecture-is-designed-and-how-they-work</link>
<description>
&lt;p&gt;Hello, I'm Ganesh. I'm building &lt;em&gt;git-lrc&lt;/em&gt;, an AI code reviewer that runs on every commit. It is free, unlimited, and source-available on Github. &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Star Us&lt;/a&gt; to help devs discover the project. Do give it a try and share your feedback for improving the product.&lt;/p&gt;

&lt;p&gt;In the previous article, We have seen how to setup nginx on ubuntu and enable the site. It was more into basic where anyone one who wants to configure domain or any other thing can follow it.&lt;/p&gt;

&lt;p&gt;Now in this article we will explore a how nginx works.&lt;/p&gt;

&lt;h2&gt;
  
  
  How Nginx Architecture and How they Works?
&lt;/h2&gt;

&lt;p&gt;Before we go into how nginx works, we need to understand the architecture of nginx.&lt;/p&gt;

&lt;p&gt;Nginx has two main components: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Master Process&lt;/li&gt;
&lt;li&gt;Worker Process&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Master process is to read, evaluate configuration files and maintain worker process.&lt;/p&gt;

&lt;p&gt;Worker Process will do all the processing of client requests. &lt;/p&gt;

&lt;p&gt;Nginx works on principle of event-based and OS-dependent mechanisms to efficiently distribute requests among worker processes.&lt;/p&gt;

&lt;p&gt;The number of worker process can be configured in the nginx.conf file and this can also be automatically set based on the number of CPU cores available on the system.&lt;/p&gt;

&lt;p&gt;For more information on how to configure the number of worker process, please refer to the official documentation &lt;a href=&quot;https://nginx.org/en/docs/ngx_core_module.html#worker_processes&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;Worker Processes&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;By default, the configuration file is named &lt;code&gt;nginx.conf&lt;/code&gt; and placed in the directory &lt;code&gt;/usr/local/nginx/conf&lt;/code&gt;, &lt;code&gt;/etc/nginx&lt;/code&gt;, or &lt;code&gt;/usr/local/etc/nginx&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Start, Stop and Reload Nginx?
&lt;/h2&gt;

&lt;p&gt;To Control any operation of nginx, we need to use the executable file. &lt;/p&gt;

&lt;p&gt;This will be having this syntax:&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;nginx &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; signal
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Where signal may be one of the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;stop &amp;mdash; fast shutdown&lt;/li&gt;
&lt;li&gt;quit &amp;mdash; graceful shutdown&lt;/li&gt;
&lt;li&gt;reload &amp;mdash; reloading the configuration file&lt;/li&gt;
&lt;li&gt;reopen &amp;mdash; reopening the log files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example, to stop nginx processes with waiting for the worker processes to finish serving current requests, the following command can be executed:&lt;br&gt;
&lt;/p&gt;

&lt;div class=&quot;highlight js-code-highlight&quot;&gt;
&lt;pre class=&quot;highlight shell&quot;&gt;&lt;code&gt;nginx &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; quit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;As of now we understand how Nginx architecture works and how to control Nginx. &lt;/p&gt;

&lt;p&gt;In the next article, we will go in-depth on how to use these signals to control Nginx.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;&lt;img src=&quot;https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fabn6nl3iehrohehnxgje.png&quot; alt=&quot;git-lrc&quot; width=&quot;800&quot; height=&quot;373&quot;&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Any feedback or contributors are welcome! It&amp;rsquo;s online, source-available, and ready for anyone to use. &lt;br&gt;
&amp;#11088; Star it on GitHub: &lt;a href=&quot;https://github.com/HexmosTech/git-lrc&quot; rel=&quot;noopener noreferrer nofollow&quot;&gt;https://github.com/HexmosTech/git-lrc&lt;/a&gt;&lt;/p&gt;


</description>
<category>Other</category>
<guid isPermaLink="true">https://coderlegion.com/14073/how-nginx-architecture-is-designed-and-how-they-work</guid>
<pubDate>Thu, 09 Apr 2026 02:36:18 +0000</pubDate>
</item>
</channel>
</rss>