nginx as the load balance use upstream_fair

PstreeM China pstreem at
Tue Feb 16 14:36:08 UTC 2021

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

configuration the fair as the load balance policy, but there is some
mistake when i start the service like:
root at env:/usr/local/etc/nginx # service nginx onerestart
Performing sanity check on nginx configuration:
nginx: [emerg] "fair" directive is not allowed here in
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/;
load_module /usr/local/libexec/nginx/;
load_module /usr/local/libexec/nginx/;
load_module /usr/local/libexec/nginx/;

stream {

        upstream backend {
                server server1:443;
                server server2:443;
                server server3:443;

        server {
                listen       4443;
                proxy_pass      backend;



More information about the freebsd-questions mailing list