From owner-freebsd-questions@freebsd.org Tue Feb 16 16:20:42 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 CFAA053E563 for ; Tue, 16 Feb 2021 16:20:42 +0000 (UTC) (envelope-from pstreem@gmail.com) Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) (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 4Dg5mp0vnwz4g91 for ; Tue, 16 Feb 2021 16:20:41 +0000 (UTC) (envelope-from pstreem@gmail.com) Received: by mail-io1-xd34.google.com with SMTP id y5so6948285ioc.2 for ; Tue, 16 Feb 2021 08:20:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Runp7N8dbRlHEObPoUgXj/vpBaLNbfRuoDXLZMkHgtM=; b=omAEeazoS7XDPIdbVBioHzwEBk+ijzcDm6EKh5nUZ+uhHLndSUCvDNVUPGw9U+F0Zo OEwvxOd76irVGWKrMsPa6IYyQ8fktAYQSt1KLMMJw5knIHoSdxqoUPROkXb7uUYu4xbb H3jRc2JS3CnOrx8KneSKSGGNMfPxpnYi/k95f5GEKxtJpXBmZm3w5kdAiz5uQOuQFCfo hrGawEhGbtBbriFWom9ufAIjVg4QmC4UuP1IHBp+OMR832HVCPvG4vyp4DgnE2p+GT4D JCmuqFiCUs7IfhojdTdu22BhtljP/pfyuXCe+D3nJQBUiQ4B+xM64fhA3B9tHvsGrmYo 1mnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Runp7N8dbRlHEObPoUgXj/vpBaLNbfRuoDXLZMkHgtM=; b=ny3pKXPssO4woonh3sQ0vRrV6XHyLC+obUZQKymfOPFKZ/a/1yW2yXL19QjHybDMj5 9HMluybnaFNfyDahKvPlXRUzoELMK7Iz/QuxpJTQVWglKxgujzjuJ16yG9iFWhOXSgYN gnaiAiHOEVikfjw1Ai4a8no+lCwMzC0W8AZTpYaf7xp+TNiulZuMw+WNOLz0i5N8nLFN Q+Sr9jcb+05b11kv03YmavsnjkUT1t02aPGJ1+09i5bpsNKla/F3dhJMFhGCxMsjTM99 iTqhsyiKy5VOfJ+u/daP2iZr89ZQD4OFidwypK8D1WUOc2YBcJxVGd4K0soZtTkrdiSY 8nXQ== X-Gm-Message-State: AOAM532MP+1/gYTaB4n/StoBRMuwm8Nq+mFIZ9JcmyAKCehZhQ0FkMJ2 T/GCXCdvVPtixh5Lzn3KtbeXYVAXisnLG4wWmfOXsMcoJz8= X-Google-Smtp-Source: ABdhPJxf4BFUTc9WuEThAj7EpRTb947V6mERva5pj+QzA/MrYEwLbjXfUAUh3YT18adFHTEHOmUB6sx678Hb77+DRks= X-Received: by 2002:a5d:939a:: with SMTP id c26mr17859643iol.63.1613492440816; Tue, 16 Feb 2021 08:20:40 -0800 (PST) MIME-Version: 1.0 References: <20210216161324.GN20539@mailboy.kipshouse.net> In-Reply-To: <20210216161324.GN20539@mailboy.kipshouse.net> From: PstreeM China Date: Wed, 17 Feb 2021 00:20:29 +0800 Message-ID: Subject: Re: nginx as the load balance use upstream_fair To: Karl Young Cc: freebsd-questions@freebsd.org X-Rspamd-Queue-Id: 4Dg5mp0vnwz4g91 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=omAEeazo; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of pstreem@gmail.com designates 2607:f8b0:4864:20::d34 as permitted sender) smtp.mailfrom=pstreem@gmail.com X-Spamd-Result: default: False [-4.00 / 15.00]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RBL_DBL_DONT_QUERY_IPS(0.00)[2607:f8b0:4864:20::d34: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)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; SPAMHAUS_ZRD(0.00)[2607:f8b0:4864:20::d34:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d34: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 16:20:42 -0000 Hello: Thanks for your quick response. Yes. The reason for install nginx by ports is to enable the fair module. And double check , the 4 file which I loaded is there. > 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; On Wed, Feb 17, 2021 at 00:13 Karl Young wrote: > PstreeM > > Did you enable the HTTP_UPSTREAM_FAIR option when you installed the > port? > > > HTTP_UPSTREAM_FAIR=off: 3rd party upstream fair module > > Does this file exist? > > /usr/local/libexec/nginx/ngx_http_upstream_fair_module.so > > Regards, > > -karl > > PstreeM China(pstreem@gmail.com)@2021.02.16 22:35:55 +0800: > > 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 > > _______________________________________________ > > freebsd-questions@freebsd.org mailing list > > https://lists.freebsd.org/mailman/listinfo/freebsd-questions > > To unsubscribe, send any mail to " > freebsd-questions-unsubscribe@freebsd.org" >