From owner-freebsd-questions@freebsd.org Tue Feb 16 14:36:08 2021 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D50B853A77B for ; Tue, 16 Feb 2021 14:36:08 +0000 (UTC) (envelope-from pstreem@gmail.com) Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Dg3S831Ytz4VFt for ; Tue, 16 Feb 2021 14:36:08 +0000 (UTC) (envelope-from pstreem@gmail.com) Received: by mail-io1-xd31.google.com with SMTP id n14so10377170iog.3 for ; Tue, 16 Feb 2021 06:36:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=+VBM5RCT2f3fBHUqo2zaHkbaHZK8nm8dSdeaT4X0Nqc=; b=uDNbZWxs7ZnYjJY87VfJ9Q5v84rlyejNjpe5FppjGx4mrOKiGokvKJy9wowCvYDcWI RMwocoXrnoMYJejG8LyrVLIvYnLSNKm4wVnkgQxKzJBt/0CjBYW+SfBsqR2ORoM43n1T GyE0UOgfngnpTzteriPGjOj+ZX0MlDkxn7P4cYy4VQ2LwczVo0n7mxH2l1VPywVaW/rR uvpXdMlKVN/J/ZpsPf8svgQKN65VtF111hrb9eD4PA72bBfL1KKzWMrAtDrWFfseIJ8d 0u4fgDe6EGB7OP/whMBD6YekUXG9vd5Vdr6g8L2PcbWpN4IKzAL2Hz4q/J+kF0UKKLP6 /BPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=+VBM5RCT2f3fBHUqo2zaHkbaHZK8nm8dSdeaT4X0Nqc=; b=A1Y18HHYEobTiXRsvH4AmFWK8Pm8DX0Ee0CPkQd4Ul73YN75mV1dSCsKyASXbrZn2E gYNPyISB9CQvBLw6rB1ARhE0m3iNQ0HP5PdM6jK+8mbPT3+Oh4sI06pv1ifeWnFUZIzs HLCoYA628IwbojrMpCVYrA2Os63g5goUC2KCsqqiPCmQ1Cors+/hoNqHJCCu83ibJgI+ RNNrD6vQiIQ59rbhHO2w5gX+mU2hvJ1hAH76rRd0T02Wi2arwBNMdDEZvuEdtDErC0RV PRpNkRDNSKeLADrRbD1pEvs/iuM3n4OjH9rclnBamsqdLcwKJ+FPEEIsbT0CHE+2m1ub gZeg== X-Gm-Message-State: AOAM532h0yx9e3EcVoOZizQXGLQnHZ3rbnrylR8mEQkYyTtIczHaUbM0 hwocsKQzp+1XCBkN81s1OUTD546YystRaho/5v4ukeDOtWfgOg== X-Google-Smtp-Source: ABdhPJwwL0//jHRHrArtIh5r43/z5G5ICJmIsWlfE322EXIOopX8S6Q4Bzg3Ce/ucNGRHSO2Yo995WlHCjPSmEqz9TM= X-Received: by 2002:a05:6638:111a:: with SMTP id n26mr3521929jal.93.1613486166993; Tue, 16 Feb 2021 06:36:06 -0800 (PST) MIME-Version: 1.0 From: PstreeM China Date: Tue, 16 Feb 2021 22:35:55 +0800 Message-ID: Subject: nginx as the load balance use upstream_fair To: freebsd-questions@freebsd.org X-Rspamd-Queue-Id: 4Dg3S831Ytz4VFt X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=uDNbZWxs; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of pstreem@gmail.com designates 2607:f8b0:4864:20::d31 as permitted sender) smtp.mailfrom=pstreem@gmail.com X-Spamd-Result: default: False [-3.99 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.99)[-0.994]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::d31:from]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::d31:from:127.0.2.255]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d31:from]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-questions] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Feb 2021 14:36:08 -0000 hello expert: need your help for this issue, from the google can not find any similar case. use freebsd 12.2 system. and install nginx by ports, the version is:nginx-1.18.0_47,2 configuration the fair as the load balance policy, but there is some mistake when i start the service like: =============== root@env:/usr/local/etc/nginx # service nginx onerestart Performing sanity check on nginx configuration: nginx: [emerg] "fair" directive is not allowed here in /usr/local/etc/nginx/nginx.conf:35 nginx: configuration file /usr/local/etc/nginx/nginx.conf test failed =============== then,test if cancel the config "#fair", it running well. =============== Performing sanity check on nginx configuration: nginx: the configuration file /usr/local/etc/nginx/nginx.conf syntax is ok nginx: configuration file /usr/local/etc/nginx/nginx.conf test is successful Starting nginx. ============== search from google and read the guide from nginx official site, the example configure is all like this. i don't know how to fix this ? thanks very much for your help. the part of configuration as below: --------------------- load_module /usr/local/libexec/nginx/ngx_stream_module.so; load_module /usr/local/libexec/nginx/ngx_http_dynamic_upstream_module.so; load_module /usr/local/libexec/nginx/ngx_http_upstream_fair_module.so; load_module /usr/local/libexec/nginx/ngx_http_sticky_module.so; stream { upstream backend { server server1:443; server server2:443; server server3:443; fair; } server { listen 4443; proxy_pass backend; } } ------------------------- BR//Armin