nginx基本設定

2021-08-15 04:36:46 字數 480 閱讀 4097

user nobody;

#啟動程序,通常設定成和cpu的數量相等

worker_processes 1;

#全域性錯誤日誌及pid檔案

#error_log logs/error.log;

#error_log logs/error.log notice;

#error_log logs/error.log info;

#pid logs/nginx.pid;

#工作模式及連線數上限

# 定義錯誤提示頁面

error_page 500 502 503 504 /50x.html;

location = /50x.html

#禁止訪問 .ht*** 檔案

location ~ /.ht

}}

**張永光的部落格

Nginx設定HTTP基本驗證

分享一下我老師大神的人工智慧教程!零基礎,通俗易懂!假設我們已經在ubuntu12.04 server上安裝了nginx.現在我要給你們看看如何在nginx上配置http基本驗證。step1 開啟conf nginx.conf檔案,新增下面的指令 location restricted 單詞將會出現...

nginx快取設定

目的 快取nginx伺服器的靜態檔案。如css,js,htm,html,jpg,gif,png,flv,swf,這些檔案都不是經常更新。便於快取以減輕伺服器的壓力。實現 nginx proxy cache可以將使用者的請快取到本地乙個目錄,當下乙個請求時可以直接調取快取檔案,就不用去後端伺服器去取檔...

nginx超時設定

nginx常用的超時配置說明 client header timeout 語法 client header timeout time 預設值 60s 上下文 http server 說明 指定等待client傳送乙個請求頭的超時時間 例如 get http 1.1 僅當在一次read中,沒有收到請求...