{"id":1732,"date":"2023-11-03T11:59:41","date_gmt":"2023-11-03T11:59:41","guid":{"rendered":"https:\/\/matob.web.id\/random\/?p=1732"},"modified":"2023-11-03T11:59:41","modified_gmt":"2023-11-03T11:59:41","slug":"nginx","status":"publish","type":"post","link":"https:\/\/matob.web.id\/random\/nginx\/","title":{"rendered":"What is Nginx and How It Works?"},"content":{"rendered":"<p>The role of the web server is vital so that the website can run well. Therefore, selecting a <a href=\"https:\/\/matob.web.id\/random\/technology\/server\/\">web server<\/a> must also be by the needs and performance so far. One of the web servers currently available is <a href=\"https:\/\/matob.web.id\/random\/technology\/nginx\">Nginx<\/a> (read: engine-ex).\u00a0Want to know what Nginx is?<\/p>\n<p>Now! In this article, we will discuss various things related to Nginx, such as what Nginx is, the history, advantages, and comparisons of Nginx with other web servers (in this case, Apache and LiteSpeed).<\/p>\n<h2>What is Nginx?<\/h2>\n<p><img fetchpriority=\"high\" decoding=\"async\" class=\"wp-image-1737 aligncenter\" src=\"https:\/\/matob.web.id\/random\/wp-content\/uploads\/sites\/2\/2021\/12\/Nginx-Logo.jpg\" alt=\"Nginx Logo\" width=\"912\" height=\"440\" title=\"\" srcset=\"https:\/\/matob.web.id\/random\/wp-content\/uploads\/sites\/2\/2021\/12\/Nginx-Logo.jpg 1500w, https:\/\/matob.web.id\/random\/wp-content\/uploads\/sites\/2\/2021\/12\/Nginx-Logo-768x370.jpg 768w\" sizes=\"(max-width: 912px) 100vw, 912px\" \/><\/p>\n<p>Nginx is a web server with reliable performance and has several other powerful features that are easy to configure. As a result, Nginx can make your website more powerful and sophisticated.<\/p>\n<p>In the beginning, Nginx was only used for HTTP servers. Along with technology development, Nginx is now used as an HTTP cache, <em>load balancer\u00a0<\/em>(HTTP, TCP, and UDP), and\u00a0<em>proxy server\u00a0<\/em>(IMAP, POP3, and SMTP).<\/p>\n<p>In addition to the above capabilities, Nginx can run on various operating systems, such as Linux, Mac OS X, HP-UX, BSD Variant, and Solaris.<\/p>\n<p>Nginx is used in various large companies, including Atlassian, Intuit, T-Mobile, GitLab, Microsoft, DuckDuckGo, IBM, Google, Adobe, Salesforce, Xerox, VMWare, LinkedIn, Cisco, Facebook, Twitter, Apple, and many others.<\/p>\n<p>Nginx was initially developed by Igor Sysoev (Software Engineer from Russia) and released in October 2014. At that time, there was a problem known as C10k or system performance problems when handling 10 thousand connections simultaneously. Igor tried to try to solve the problem.<\/p>\n<p>So Igor created Nginx, which offers high concurrency usage and can handle thousands of concurrent connections with low memory usage. Nginx uses an <em>asynchronous\u00a0<\/em>process\u00a0(executing code before the previous command finishes executing) rather than creating a new process for each line of code execution.<\/p>\n<p>Not only adding\u00a0<em>asynchronous\u00a0<\/em>processes, Nginx also takes an event-driven approach. The event-driven system handles <em>requests\u00a0<\/em>(requests or functions) in one thread. Nginx revolutionized web servers&#8217; work through these various technologies and became the most popular.<\/p>\n<p>After opening the project publicly in 2004 and seeing continued use, Igor tried to develop Nginx and enter the market with Nginx Plus. Nginx Plus can handle hundreds or even thousands of connections and has been used by over 500 business websites.<\/p>\n<h2><strong>How Does NGINX Work?<\/strong><\/h2>\n<figure id=\"attachment_1738\" aria-describedby=\"caption-attachment-1738\" style=\"width: 1024px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"size-full wp-image-1738\" src=\"https:\/\/matob.web.id\/random\/wp-content\/uploads\/sites\/2\/2021\/12\/NGINX-WORKS.png\" alt=\"\" width=\"1024\" height=\"589\" title=\"\" srcset=\"https:\/\/matob.web.id\/random\/wp-content\/uploads\/sites\/2\/2021\/12\/NGINX-WORKS.png 1024w, https:\/\/matob.web.id\/random\/wp-content\/uploads\/sites\/2\/2021\/12\/NGINX-WORKS-768x442.png 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption id=\"caption-attachment-1738\" class=\"wp-caption-text\">Source: nginx.com<\/figcaption><\/figure>\n<p>Before getting to know the meaning of NGINX further, it&#8217;s good if you know how a web server works first.\u00a0When someone &#8216;sends&#8217; a request to open a webpage, the browser will contact the website&#8217;s server.\u00a0The server then looks for the webpage file requested by the user and sends it to the browser.\u00a0This flow shows how the server works on\u00a0simple\u00a0<em>requests<\/em>\u00a0or\u00a0<em>requests<\/em>.<\/p>\n<p>The above example can also be referred to as a\u00a0<em>single thread<\/em>.\u00a0Web servers usually create a\u00a0<em>single line <\/em>for each request, but not with NGINX. As previously mentioned, NGINX runs an asynchronous, <em>event-driven\u00a0<\/em>architecture. This indicates that the same or similar threads are managed under a single\u00a0<em>worker process<\/em>, and each\u00a0<em>worker process comprises<\/em>\u00a0smaller units called\u00a0<em>worker connections<\/em>.\u00a0This entire unit is in charge of handling\u00a0<em>thread requests<\/em>.\u00a0<em>Worker connection\u00a0<\/em>sends a request to the <em>worker process<\/em>, which it also sends to the\u00a0<em>controller process<\/em>.\u00a0<em>The controller process <\/em>then displays the results of the request or\u00a0<em>request<\/em>.<\/p>\n<p>At first, glance, how <a href=\"https:\/\/matob.web.id\/random\/technology\/nginx\">NGINX<\/a> works looks easy, but you need to know that a single\u00a0<em>worker connection\u00a0<\/em>can handle up to 1024 same and similar requests. Because of this, NGINX can process thousands of requests without any difficulty. This ability also makes it a server often used by high-traffic websites, such as e-commerce, search engines, and\u00a0<em>cloud storage<\/em>.<\/p>\n<h2>Advantages of Nginx<\/h2>\n<p>Nginx is the most popular web server in its class and is a data delivery solution for high-traffic websites such as Dropbox, Netflix, and Zynga. More than 385 million websites worldwide, including 100 thousand business websites, use Nginx as a web server to deliver their content quickly, reliably, and efficiently. Nginx offers several advantages:<\/p>\n<h3>1.\u00a0<strong>Nginx can replace the hardware load balancer.<\/strong><\/h3>\n<p>As an open-source load balancer software, Nginx is cheaper and easier to configure than a hardware load balancer. This web server is also designed for modern cloud architecture. Nginx also supports <em>on-the-fly\u00a0<\/em>reconfiguration\u00a0and integrates with modern DevOps for easy monitoring.<\/p>\n<h3>2.\u00a0<strong>Nginx is a multifunctional tool.<\/strong><\/h3>\n<p>Apart from being used as a web server, you can also use Nginx as a load balancer, content cache, and proxy server. The monitoring process will be more straightforward since the entire configuration is centered on a single application. This, of course, also minimizes the number of tools you manage.<\/p>\n<h3>3.\u00a0<strong>There are various kinds of complete documentation.<\/strong><\/h3>\n<p>If you are new to using web servers, especially Nginx, don&#8217;t worry because Nginx provides a variety of tutorials, webinars, and documentation that is complete for you to learn.<\/p>\n<p>If you still need clarification about Nginx but still want to use it, you can use <a href=\"https:\/\/matob.web.id\/random\/1001\/what-is-localhost\/\">Nginx Plus<\/a> to get customer support facilities. So you can get help to diagnose problems that arise in Nginx.<\/p>\n<h3>4.\u00a0<strong>Nginx is still being developed.<\/strong><\/h3>\n<p>Nginx until now continues to be developed thoughtfully. Moreover, for the past decade, Nginx has been at the forefront of modern web development and has driven the development of technologies from HTTP to microservices support.<\/p>\n<p>As web content delivery develops, Nginx plans to add and improve features so there is no flawed data delivery. Nginx also recently announced that it will implement Nginx-tailored JavaScript and support for dynamic modules.<\/p>\n<h2>Comparison of Nginx with Other Web Servers<\/h2>\n<p>Several web servers are available today besides Nginx, such as Apache Web Server and LiteSpeed \u200b\u200bWeb Server. In terms of popularity, Nginx is more popular than the others. Still, in terms of performance, it seems that Nginx has to do some development to compete with LiteSpeed \u200b\u200bWeb Server, mainly if you use WordPress.<\/p>\n<h3><strong>Nginx Vs. Apache Comparison<\/strong><\/h3>\n<p>Apache is another popular web server that rivals Nginx. About 33.5% of websites on the internet use the Apache web server. This number is similar to Nginx, which is 34% of the total.<\/p>\n<p>Here&#8217;s a diagram that you can also see on <strong><a href=\"https:\/\/w3techs.com\/technologies\/cross\/web_server\/ranking\" target=\"_blank\" rel=\"noopener\">the W3Techs<\/a> <\/strong>website.<\/p>\n<p><img decoding=\"async\" class=\"size-full wp-image-1736 aligncenter\" src=\"https:\/\/matob.web.id\/random\/wp-content\/uploads\/sites\/2\/2021\/12\/Nginx.jpg\" alt=\"Nginx\" width=\"619\" height=\"484\" title=\"\"><\/p>\n<p>So, what is the difference between Nginx and Apache? If you&#8217;re looking for a web server that fits your needs, here&#8217;s a quick summary of the feature comparison between Nginx vs. Apache.<\/p>\n<h4><strong>Operating System Support<\/strong><\/h4>\n<p>Compatibility is one of the main details you must consider when choosing software. Both Nginx and Apache can run on various operating systems that use Unix systems. Unfortunately, Nginx&#8217;s performance on Windows is not as good as on other platforms\/operating systems.<\/p>\n<h4><strong>User Usage Support<\/strong><\/h4>\n<p>Beginners and professionals alike always need a community to help them find a solution when they have a problem. Nginx and Apache have nearly as strong a community as mailing support and Stack Overflow forums.<\/p>\n<h4><strong>Nginx Vs. Apache Performance Comparison<\/strong><\/h4>\n<p>Regarding performance, the power is almost the same, but Nginx is superior. Nginx can simultaneously process more than 1000 static content connections twice as fast as Apache.<\/p>\n<p>However, when compared to using dynamic content, both Nginx and Apache have the same speed performance.\u00a0So, Nginx is a good choice if it is used to process websites with static content.<\/p>\n<h3><strong>Nginx vs. LiteSpeed \u200b\u200bWeb Server Comparison<\/strong><\/h3>\n<p>LiteSpeed \u200b\u200bWeb Server&#8217;s popularity is still inferior to Nginx, but in terms of performance, LiteSpeed \u200b\u200bWeb Server cannot be underestimated. If you use LiteSpeed, you can at least benefit from Nginx and Apache on one web server. The two combinations of these advantages are Nginx&#8217;s event-driven scalability and various management tools, such as those provided by Apache.<\/p>\n<h4><strong>Nginx Vs. LiteSpeed \u200b\u200bWeb Server Performance<\/strong><\/h4>\n<p>One of the advantages that LiteSpeed \u200b\u200boffers is LiteSpeed&#8217;s more straightforward stack and intelligent cache. You can use an intelligence cache to override the functionality of third-party proxies. So you don&#8217;t need an HTTPS reverse broker or a third-party cache provider. In addition, LiteSpeed \u200b\u200bcompresses first before saving cache files, which Nginx does not do.<\/p>\n<p>The result? Nginx&#8217;s speed (using FCGI) lags far behind LiteSpeed \u200b\u200bWeb Server combined with LiteSpeed \u200b\u200b<a href=\"https:\/\/matob.web.id\/random\/1001\/what-is-cache\/\">Cache<\/a>.<\/p>\n<h4><strong>Nginx Vs. LiteSpeed \u200b\u200bWeb Server Security<\/strong><\/h4>\n<p>Security is a serious issue, so LiteSpeed \u200b\u200balso supports ModSecurity rules that Apache and Nginx also use. However, LiteSpeed \u200b\u200bdoes it without sacrificing performance. LiteSpeed \u200b\u200bWeb Server also offers support for using reCaptcha, brute force attack protection, and other anti-DDoS measures that Nginx also has.<\/p>\n<h2>Conclusion<\/h2>\n<p>Nginx is a reliable web server. Not only that, but Nginx also has several additional features that make it easier for users to use manage proxy servers, load balancers, and HTTP caches.<\/p>\n<p>The trust of well-known websites from Netflix, Facebook, Twitter, GitLab, Microsoft, DuckDuckGo, IBM, Google, and other big websites proves Nginx&#8217;s greatness. All of these websites entrust Nginx as a web server on their website.<\/p>\n<p>Nginx is a web server that also functions as an email proxy, reverse proxy, and load balancer. The structure of this software is asynchronous and <em>event-driven<\/em>, which allows many requests or requests to be processed simultaneously. Apart from that, Nginx is also scalable. This shows that this service grows and develops along with the increasing traffic coming to the website. Finally, Nginx and Apache are two of the best web servers on the market.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The role of the web server is vital so that the website can run well. Therefore, selecting a web server must also be by the needs and performance so far. One of the web servers currently available is Nginx (read: engine-ex).\u00a0Want to know what Nginx is? Now! In this article, we will discuss various things [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1739,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[181,78],"class_list":["post-1732","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","tag-nginx","tag-server"],"_links":{"self":[{"href":"https:\/\/matob.web.id\/random\/wp-json\/wp\/v2\/posts\/1732","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/matob.web.id\/random\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/matob.web.id\/random\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/matob.web.id\/random\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/matob.web.id\/random\/wp-json\/wp\/v2\/comments?post=1732"}],"version-history":[{"count":2,"href":"https:\/\/matob.web.id\/random\/wp-json\/wp\/v2\/posts\/1732\/revisions"}],"predecessor-version":[{"id":26038,"href":"https:\/\/matob.web.id\/random\/wp-json\/wp\/v2\/posts\/1732\/revisions\/26038"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/matob.web.id\/random\/wp-json\/wp\/v2\/media\/1739"}],"wp:attachment":[{"href":"https:\/\/matob.web.id\/random\/wp-json\/wp\/v2\/media?parent=1732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/matob.web.id\/random\/wp-json\/wp\/v2\/categories?post=1732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/matob.web.id\/random\/wp-json\/wp\/v2\/tags?post=1732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}