Nginx 核心功能模塊負責 Nginx 的全局應用,主要對應主配置文件的 Main 區塊和 Events 區塊,這裏有不少 Nginx 必須的全局參數配置。html
實例:vim
user nginx nginx;
worker_processes auto;
error_log logs/error.log error;
events {
worker_connections 1024;
}
Nginx http 功能模塊 | 模塊說明 |
---|---|
ngx_http_core_module | 包括一些核心的 http 參數配置,對應 Nginx 的配置爲 HTTP 區塊部分 |
ngx_http_access_module | 訪問控制模塊,用來控制網站用戶對 Nginx 的訪問 |
ngx_http_gzip_module | 壓縮模塊,對 Nginx 返回的數據壓縮,屬於性能優化模塊 |
ngx_http_fastcgi_module | FastCGI 模塊,和動態應用相關的模塊,如 PHP |
ngx_http_proxy_module | proxy 代理模塊 |
ngx_http_upstream_module | 負載均衡模塊,可實現網站的負載均衡和節點的健康檢查 |
ngx_http_rewrite_module | URL 地址重寫模塊 |
ngx_http_limit_conn_module | 限制用戶併發鏈接數以及請求數的模塊 |
ngx_http_limit_req_module | 根據定義的 key 限制 Nginx 請求過程的速率 |
ngx_http_log_module | 訪問日誌模塊,以指定的格式記錄 Nginx 客戶訪問日誌等信息 |
ngx_http_auth_basic_module | Web 認證模塊,設置 Web 用戶經過帳號密碼訪問 Nginx |
ngx_http_ssl_module | ssl 模塊,用於加密的 http 鏈接,如 https |
ngx_http_stub_status_module | 記錄 Nginx 基本訪問狀態信息等的模塊 |
Nginx http 功能模塊詳情請看下面的官方文檔性能優化