nginx 配置說明

2021-06-28 10:56:36 字數 1261 閱讀 4892



#定義nginx執行的使用者和使用者組

user www www;

#nginx程序數,建議設定為等於cpu總核心數。

worker_processes 8;

#全域性錯誤日誌定義型別,[ debug | info | notice | warn | error | crit ]

error_log ar/loginx/error.log info;

#程序檔案

pid ar/runinx.pid;

#乙個nginx程序開啟的最多檔案描述符數目,理論值應該是最多開啟檔案數(系統的值ulimit -n)與nginx程序數相除,但是nginx分配請求並不均勻,所以建議與ulimit -n的值保持一致。

worker_rlimit_nofile 65535;

#工作模式與連線數上限

events

#設定http伺服器

# 虛擬主機的配置

server

#快取時間設定

#js和css快取時間設定

location ~ .*.(js|css)?$

#日誌格式設定

#定義本虛擬主機的訪問日誌

access_log ar/loginx/ha97access.log access;

#對 "/" 啟用反向**

location /

#設定檢視nginx狀態的位址

location /nginxstatus

#本地動靜分離反向**配置

#所有 jsp的頁面均交由tomcat或resin處理

location ~ .(jsp|jspx|do)?$

#所有靜態檔案由nginx直接讀取不經過tomcat或resin

nginx配置說明

依賴 zlib,pcre,openssl configure prefix usr local nginx with openssl usr include 啟用ssl with pcre usr include pcre 啟用正規表示式 with http stub status module 安...

Nginx配置說明

nginx配置引數中文詳細說明 定義nginx執行的使用者和使用者組 user www www nginx程序數,建議設定為等於cpu總核心數.worker processes 8 全域性錯誤日誌定義型別,debug info notice warn error crit error log var...

Nginx 配置說明

定義nginx執行的使用者和使用者組 user www www nginx程序數,建議設定為當前主機的cpu總核心數。worker processes 8 全域性錯誤日誌定義型別,debug info notice warn error crit error log ar loginx error....