Nginx 配置檔案

2021-09-13 19:14:02 字數 670 閱讀 2678

[root@python conf]# cat nginx.conf

user nobody; # 設定使用者和使用者組,預設nobody;

worker_processes 1; # 設定執行nginx的cpu的個數,通常略少於伺服器cpu個數;

error_log logs/error.log notice;

## 設定錯誤日誌,[ debug|info|notice|warn|error|crit ] 定義級別,debug最詳細,crit最簡單;

## 關閉錯誤日誌,error_log /dev/null crit;

pid logs/nginx.pid; # 把nginx程序號記錄到檔案,用於管理nginx程序;

## upstrem模組中設定負載均衡規則,然後在server模組中進行呼叫完成負載均衡配置;

## weight設定權重,可不設定,以輪詢方式;可設定backup備用伺服器;

## ip_hash,每乙個ip位址按雜湊結果固定乙個後端伺服器,解決session的問題;

server $1 permanent;

## 將所有80埠的請求重定向到443埠;

}server

}}

nginx配置檔案

執行使用者 user nobody nobody 啟動程序 worker processes 2 全域性錯誤日誌及pid文件 error log logs error.log notice pid logs nginx.pid 工作模式及連線數上限 events 設定http伺服器,利用他的反向 功...

nginx 配置檔案

ps nginx使用有兩三年了,現在經常碰到有新使用者問一些很基本的問題,我也沒時間一一回答,今天下午花了點時間,結合自己的使用經驗,把nginx的主要配置引數說明分享一下,也參考了一些網路的內容,這篇是目前最完整的nginx配置引數中文說明了。更詳細的模組引數請參考 定義nginx執行的使用者和使...

Nginx 配置檔案

2 配置詳解 3 配置備份 nginx 配置檔案主要分為六個區域 nginx worker 程序的執行使用者以及使用者組,預設由 nobody 賬號執行。user nobody nginx 要開啟的子程序數。每個 nginx 程序平均耗費 10m 12m 記憶體,一般指定 1 個程序就足夠了。若是多...