簡體   English   中英

nginx未知指令“ keepalive”

[英]nginx unknown directive “keepalive”

我正在使用以下配置

upstream site {
    server 127.0.0.1:3000;
    keepalive 64;
}

server {
    listen 80;

    error_page 400 404 500 502 503 504 /50x.html;
    location  /50x.html {
            internal;
            root /usr/share/nginx/www;
    }

    location /static {
        root /opt/site/static;
        access_log off;
        expires max;
    }

    location / {
        proxy_redirect off;
        proxy_set_header   X-Real-IP            $remote_addr;
        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_set_header   Host                   $http_host;
        proxy_set_header   X-NginX-Proxy    true;
        proxy_set_header   Connection "";
        proxy_http_version 1.1;
        proxy_pass         http://site;
        proxy_intercept_errors on;
    }
}

我已將其保存到/etc/nginx/sites-available/site.conf並與它/etc/sites-enabled/site.conf符號鏈接,當我重新啟動nginx時,出現以下錯誤:

Restarting nginx: [emerg]: unknown directive "keepalive" in /etc/nginx/sites-enabled/site.conf:3

沒有keepalive指令。 請改用keepalive_timeout 而且你不能把它放在upsream ,不能在httpserverlocation

選項“ keepalive”由keepalive模塊提供。 從1.1.4開始,keepalive功能已包含在主要代碼中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM