Skip to main content

NGINX beginner

NGINX là gì?
nginx [engine x] is an HTTP and reverse proxy server, as well as a mail proxy server, written by Igor Sysoev.
là một HTTP/reverse proxy/mail proxy server được viết để giải quyết bài toán C10K, hiện tại là một trong 2 HTTP server phổ biến nhất trên nền UNIX-like OSes. (theo http://wiki.nginx.org/Main )

Làm thế nào để trở thành một NGINX beginner?
Có nhiều cách, sau đây là 1 cách vớ vẩn nhất:
- Cài nginx
- Đọc http://nginx.org/en/docs/beginners_guide.html


Đó không phải là cách để giúp bạn config nginx thành 1 reverse-proxy nhanh nhất, hay cấu hình để nginx chạy website PHP của bạn ngay lập tức. Nhưng là một tài liệu phải đọc nếu bạn dùng NGINX.

Có gì hay?
- Một ít kiến thức về SIGNAL
- Syntax config của NGINX
- Biết cách dùng các directive để config NGINX

Trích vài đoạn hay ho:

nginx consists of modules which are controlled by directives specified in the configuration file. Directives are divided into simple directives and block directives. A simple directive consists of the name and parameters separated by spaces and ends with a semicolon (;). A block directive has the same structure as a simple directive, but instead of the semicolon it ends with a set of additional instructions surrounded by braces ({ and }). If a block directive can have other directives inside braces, it is called a context (examples: events, http, server, and location).
Directives placed in the configuration file outside of any contexts are considered to be in the main context. The events and http directives reside in the main context, server in http, and location in server.
The rest of a line after the # sign is considered a comment. 

location / {
    root /data/www;
}
This location block specifies the “/” prefix compared with the URI from the request. For matching requests, the URI will be added to the path specified in the root directive, that is, to /data/www, to form the path to the requested file on the local file system. If there are several matching location blocks nginx selects the one with the longest prefix. The location block above provides the shortest prefix, of length one, and so only if all other location blocks fail to provide a match, this block will be used. 

A regular expression should be preceded with ~.  

đã đọc đến đây?

Hello world, bạn đã trở thành NGINX beginner

Bài tiếp theo:
http://www.familug.org/2014/08/nginx-luat-matching-khi-chon-location-e.html

Comments

Popular posts from this blog

Tài liệu và hướng dẫn học Python

Để tiết kiệm thời gian, tốt nhất là đi học PyMI Updated: 130617 Sau đây là các tài liệu khuyên dùng: Vì nhiều lý do, nên học python2.7 tại thời điểm hiện tại (giờ là tháng 6/2013 - muốn biết tại sao thì tự tìm hiểu) python 3.5+ (giờ là tháng 2/2017) Chuẩn bị: 1. biết bật tắt máy 2. biết cài python 3. tập gõ 10 ngón - gõ 2 ngón hay 1 ngón cũng không sao, nhưng 10 ngón là cách dễ nhất để gõ nhanh nhất. Tài liệu - Nên dùng tài liệu tại trang chủ của Python làm chính, tham khảo thêm các tài liệu khác tại http://www.familug.org/2016/12/free-ebook.html Căn bản, mới học 1.1 Python PyMI.vn https://pymi.vn/tutorial/ 1.2. Python offical tutorial kết hợp làm bài tập trên HackerRank  (đề bài bằng tiếng Anh, nhưng Google translate 1 lúc cũng ra vì có nhiều ví dụ mẫu đi kèm). Học viên của Pymi.vn có rất nhiều học viên đã tự học với Learn Python the hard way nhưng chưa thấy ai thành công cả. Hai link dưới nên đọc sau khi đã nắm được những phần cơ bản của ngôn ngữ pytho...

The PyMiers

New FAMILUG