Automatically translated.View original post

What is nginx

# Trending # Lemon 8 Howtoo # Web Site Writing Basics # webserver # nginx

Installing Nginx (read "Engine-X") on Ubuntu Server is the gold standard for Web Infrastructure because it is light, fast and flexible.

Here are some of the main benefits you can get from using Nginx:

1. Becoming a high-performance Web Server

Nginx is designed to handle many concurrent connections using significantly fewer resources (RAM / CPU) than Apache. It is very suitable for:

Transmission of Static Content such as Images, CSS, JavaScript is extremely fast.

It supports enormous traffic, with the server machine also running stationary.

2. Reverse Proxy (Smart Outpost)

This is the most popular feature. Nginx can act as an "outpost," receive requests from the Internet and then forward them to the application server behind it (such as Node.js, Python, PHP).

Benefits: Helps hide backyard complexity and increase security because the User doesn't talk directly to App Server.

3.Load Balancer (Workload Distribution)

If you have multiple servers, Nginx can help distribute Traffic to machines equally to prevent one from overworking.

4.SSL Termination (Safety Management)

Instead of having your application decode HTTPS itself every time, you can give this function to Nginx.

It makes it easy to manage Certificates (such as Let's Encrypt) in one place.

Reduce the processing load of the main application.

5. Ease of installation on Ubuntu

Because Ubuntu is a highly popular operating system, installing Nginx is easy to do with only a few commands:

Bash

Sudo apt update

Sudo apt install nginx

And there is a very large community. If you are addicted to a problem, you can find a solution in Ubuntu almost immediately.

In a nutshell: If you want your website or API to be "fast, stable and supported by a lot of people," Nginx is the answer.

2/3 Edited to

... Read moreจากประสบการณ์ที่ใช้ Nginx กับเซิร์ฟเวอร์ Ubuntu หลายโปรเจ็กต์ ผมเห็นว่าความน่าสนใจของ Nginx นอกจากจะเป็นเว็บเซิร์ฟเวอร์ที่จัดการคำร้องขอจำนวนมากได้อย่างมีประสิทธิภาพแล้ว ยังมีความยืดหยุ่นในการจัดการระบบหลังบ้านที่โดดเด่นมาก อย่างหนึ่งที่ผมมักใช้คือฟังก์ชัน Reverse Proxy ที่ช่วยลดความซับซ้อนของระบบหลังบ้านและเพิ่มชั้นความปลอดภัยได้จริง โดยการที่ Nginx ทำหน้าที่รับ Request ก่อนแล้วส่งต่อไปยัง Application Server เช่น Node.js หรือ PHP ทำให้ผู้ใช้งานไม่สามารถเข้าถึงแอปพลิเคชันโดยตรง ลดความเสี่ยงจากการโจมตีได้มาก อีกเรื่องที่ชอบคือ Load Balancer ของ Nginx ที่ช่วยกระจายภาระงานให้กับเซิร์ฟเวอร์หลายตัวได้อย่างสมดุล เมื่อระบบมีผู้ใช้จำนวนมากทำให้เว็บไซต์สามารถทำงานได้อย่างเสถียร และไม่ล่มง่ายเมื่อมีทราฟฟิกสูง นอกจากนี้ ระบบ SSL Termination ที่ Nginx จัดการยังช่วยให้การติดตั้งและดูแลใบรับรอง SSL เช่น Let’s Encrypt เป็นเรื่องง่าย ในโปรเจ็กต์ที่เคยดูแล ผมสามารถเปิดใช้งาน HTTPS ได้รวดเร็วโดยไม่ต้องปรับแต่ง Application Server หลักเลย การติดตั้ง Nginx บน Ubuntu ก็ง่ายมาก เพียงคำสั่ง few คำสั่งก็ใช้งานได้ทันที และด้วยชุมชนผู้ใช้งานขนาดใหญ่ ทำให้เวลาผมเจอปัญหาหรือต้องการตั้งค่าพิเศษ สามารถค้นหาคำตอบและตัวอย่างวิธีแก้ได้เกือบจะทันที ถ้าคุณเป็นนักพัฒนาหรือดูแลเซิร์ฟเวอร์ที่ต้องการระบบที่เร็วและเสถียร Nginx ถือเป็นตัวเลือกที่ผมแนะนำอย่างยิ่ง เพราะทั้งช่วยประหยัดทรัพยากรระบบและรองรับผู้ใช้จำนวนมากได้ดีจริงๆ