Nginx服務學習(5)-配置文件講解

默認配置文件

頭部參數說明:

配置參數 作用
user 設置nginx服務的系統使用用戶
worker_processes 工作進程數
error_log nginx的錯誤日誌
pid nginx服務啓動時候pid

事件模塊參數說明:

模塊 配置參數 作用
events worker_connections 每個進程允許最大連接數
events use 工作進程數

http模塊:

http {
    ... ...
    server {
            listen    80;
            server_name   localhost;

            location / {
                root /usr/share/nginx/html;
                index index.html index.htm;
            }

            errot_page   500 502 503 504  /50x.html;
            location = /50x.html {
                root   /usr/share/nginx/html;
            }
    server {
        ... ...
    }       
    }
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章