nginx自從1.1.8版本發佈後將limit_conn更換為limit_conn_zone 。對應則需要修改設定檔。


syntax:  limit_zone name $variable size;

default:  —
context:  http

This directive is made obsolete in version 1.1.8, an equivalent limit_conn_zone directive with a changed syntax should be used instead:

limit_conn_zone $variable zone=name:size;


When several limit_conn directives are specified, any configured limit will apply. For example, the following configuration will limit the number of connections to the server per client IP and at the same time will limit the total number of connections to the virtual host:

limit_conn_zone $binary_remote_addr zone=perip:10m;
limit_conn_zone $server_name zone=perserver:10m;

server {
limit_conn perip 10;
limit_conn perserver 100;

These directives are inherited from the previous level if and only if there are no limit_conn directives on the current level.




limit_conn_zone $binary_remote_addr zone=perip:10m;  #容器共使用10M的記憶體來對於IP傳輸開銷對應的虛擬主機檔,將原來的limit_conn one 替換為 limit_conn perip。使用於server


limit_conn perip 10;  # 每個IP使用10個連接。

By admin


發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料