Nginx HTTP模組指令

來源:互聯網
上載者:User

標籤:des   style   blog   http   io   os   ar   使用   for   

alias 指令

該指令用於在url和系統路徑之間的映射。

location /a/{

alias /b/;

}

error_page

定義錯誤頁面

error_page 404 /404.html;

index

設定預設頁的檔案

index index.php index.html;

Listen

表示監聽連接埠

listen 80;

location

表示對不同的url 進行不同的配置

~* 不區分大小寫

~ 區分大小寫配置

location ~ \.php{

}

log_not_found

禁用404錯誤記錄檔

root

指定網站根目錄

root d:/www/;

satisfy_any

send_timeout

響應逾時時間

server指令

用於配置虛擬機器主機

server{

server_name www.a.com;

}

allow/deny

存取控制。

location /{

allow 192.168.0.0/24;

deny all;

}

autoindex

用於是否列出文檔目錄結構

autoindex on/off;

autoindex_exact_size

設定按照什麼單位來列出目錄

HTTP Broser 模組

該模組可以根據用戶端user-agent 要求標頭建立變數

$modern_brower被瀏覽器識別為新瀏覽器,則等於moder_brower_

value 命令設定的值

$msie 如果被評鑑為 msie 瀏覽器 值為1

$ancient_brower 如果瀏覽器被識別為舊的瀏覽器則等於acient_brower_value 的值

fast_buffers 指令

預設值是 4k/8k

設定fastcgi進程返回資訊的緩衝區的數量和大小

應該和系統的頁數一樣 可以通過getconf PAGESIZE 查看

fast_buffer_size 指令

設定fastcgi伺服器回應標頭部的緩衝區大大小。預設是 4k 8k

fastcgi_cache 指

設定緩衝在共用記憶體中的名

fastcgi_cache_key 

 設定被緩衝的key

fastcgi_cache_methods 

 設定哪些http請求被緩衝

預設是get、head 如果設定為post ,get、head 不會被禁用

fastcgi_hide_header 

 設定哪些回應標頭不返回給用戶端

fastcgi_max_temp_file_size 

 關閉磁碟緩衝

fastcgi_pass 

 指定fastcig 伺服器監聽的連接埠

如果有多台 的話 可以使用

upstream backend{ server localhost:1234; }

fastcgi_pass backend;

fastcgi_read_timeout 

設定upstream模組等待fastcig 進程的逾時時間。預設是60

gzip 模組

gzip on 開啟gzip

gzip_buffers 設定儲存gzip的緩衝大小

gzip_comp_level 設定壓縮的等級 1 壓縮最小處理速度最快

 9 壓縮最大很慢。

gzip_min_length 設定壓縮頁面的最小位元組數

gzip_proxied   nginx 作為反向 Proxy的時候啟用

expires指令

 

HTTP REFERE模組

 

 

 

Nginx HTTP模組指令

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.