Nginx配置指令(四)

2021-10-12 22:44:44 字數 1414 閱讀 4805

31.limit_except

語法:limit_except 方法名

預設值:no

功能:用於限制訪問location的http方法

用於location模組內

例如:limit_except get

預設值:no

功能:改指令允許根據uri的需要進行配置訪問。可以根據字面字串配置也可以使用正規表示式配置。

如果使用正規表示式配置,「~」表示區分大小寫匹配,「~*」表示不區分大小寫匹配

用於server模組

36.log_ont_found

語法:log_ont_found [on|off]

預設:log_ont_found on

功能:用於啟用或禁止在磁碟找不到檔案時,是否想error_log傳送日誌。

用於http,server,location模組。

37.log_subrequest

語法:log_subrequest [on|off]

預設值:log_subrequest off

功能:用於設定是否在訪問日誌中啟用或禁止子請求。

用於http,server,location模組

例如:有rewrite規則和ssi產生的請求,產生的訪問日誌。

38.msie_padding

語法:msie_padding  [on|off]

預設值:msie_padding on

功能:該指令用於允許或者禁止msie瀏覽器或谷歌瀏覽器的msie_padding功能。

用於http,server,location模組

39.msie_refresh

語法:msie_refresh [on|off]

預設值:msie_refresh off

功能:用於允許或者禁止給msie瀏覽器請求的享用傳送乙個refresh meta標籤。

用於http,server,location模組

40.open_file_cache

語法:open_file_cache max=n [inactive = time] |off

預設值:open_file_cache off

功能:用於設定是否啟用檔案快取。

選項:max:永固指定快取條目的最大值。當達到最大值後,根據lru演算法將快取條目移除;

inaction:用於設定乙個不活動時間,如果在這個時間內快取的條目沒有被訪問,那麼將會被刪除,預設值60秒。

off:禁止快取。

用於http,server,location模組

例如:open_file_cache max=1000 inactive=20s;

Nginx配置指令(五)

41.open file cache errors 語法 open file cache errors on off 預設 open file cache errors off 功能 開啟或禁用快取檔案錯誤。用於http,server,location模組 42.open file cache mi...

Nginx 的配置指令

我們已經了解了 nginx 的基本命令和架構原理,下面該到最讓人頭疼也是最不容易理解的部分了,那就是 nginx.conf 這個配置檔案,下面從 nginx 的指令開始,一步步來講解 nginx 的配置。先來看乙個典型的 nginx 配置檔案示例。從上面可以看到,這個配置檔案中包含了多個指令塊,有些...

Nginx 四 nginx配置例項

開啟瀏覽器,在瀏覽器位址列輸入位址 跳轉到 liunx 系統 tomcat 主頁面中 在 liunx 系統安裝 tomcat,使用預設埠 8080 對外開放tomcat 的8080埠 在 windows 系統中通過瀏覽器訪問 tomcat 伺服器 使用 nginx 反向 根據訪問的路徑跳轉到不同埠的...