Nginx學習筆記01Nginx簡要介紹與目錄說明
1.1. Nginx簡要介紹
(1)Nginx是Web服務器。
Apache、IIS:經典的通用Web服務器。
Lighttpd、Nginx:輕量級Web服務器。
Tomcat、Jetty:面向Java的Web服務器。
(2)Nginx的優點。
Nginx最吸引人的優點在於以下三個方面:
(a)支持高並發。
單機10萬並發。
(b)低內存消耗。10000個非活躍連接僅消耗2.5MB內存。
(c)熱部署。24x7不間斷服務。
(3)Nginx的架構特點。
(a)多進程架構:1個Master進程+N個worker進程。
(b)OS內核支持:基於Linux內核支持的epoll通信模型。
(c)高度可擴展:模塊化設計,
1.2. Nginx目錄
Nginx常用目錄結構如下圖所示:
目錄 |
描述 |
client_body_temp |
文件上傳臨時目錄 |
conf |
配置文件目錄,最重要的文件nginx.conf |
fastcgi_temp |
FastCGI臨時目錄 |
html |
網站目錄 |
logs |
日誌目錄 |
proxy_temp |
代理服務緩存的臨時目錄 |
sbin |
程序目錄,有nginx程序 |
scgi_temp |
SCGI臨時目錄 |
uwsgi_temp |
UWSGI臨時目錄 |
conf目錄主要內容如下圖所示:
1.3. 名詞解釋
CGI:Common Gateway Interface,通用網關接口。
FastCGI:Fast Common Gateway Interface,快速通用網關接口。CGI的改進版,借助於CGI進程管理器來優化CGI程序和Web服務器之間的交互成本。
https://en.wikipedia.org/wiki/FastCGI
SCGI:Simple Common Gateway Interface,簡單通用網關接口。類似於FastCGI,實現更簡單。
https://en.wikipedia.org/wiki/Simple_Common_Gateway_Interface
WSGI:Web Server Gateway Interface,Web服務器網關接口。
https://en.wikipedia.org/wiki/Web_Server_Gateway_Interface
UWSGI:
UWSGI做為一個協議,參考:
http://docs.jinkan.org/docs/flask/deploying/uwsgi.html
UWSGI作為一個應用服務器,參考:
http://uwsgi-docs.readthedocs.io/en/latest/
Nginx學習筆記01Nginx簡要介紹與目錄說明