Nginx: how to set up multiple servers with accept_filter=httpready

时间:2016-04-07 10:31:08

标签: nginx freebsd

On a FreeBSD machine, I have a super-simple Nginx conf file (nginx/1.8.1):

server {
  server_name .domain1.com;
  listen 80 accept_filter=httpready;
  index index.html;
  location / {
      root /home/www1;
  }
}

server {
  server_name domain2.com;
  listen 80 default_server accept_filter=httpready;
  index index.htm;
  location / {
      root /home/www2;
  }
}

This works if I only have accept_filter=httpready enabled for one of the servers. But as it is written above, it fails, with

nginx: [emerg] duplicate listen options for 0.0.0.0:80

Why can't I set accept_filter=httpready for both servers?

1 个答案:

答案 0 :(得分:2)

http://nginx.org/r/listen

  

def create_java_object(numpy_matrix): header = array.array('i', list(numpy_matrix.shape)) body = array.array('i', numpy_matrix.flatten().tolist()); if sys.byteorder != 'big': header.byteswap() body.byteswap() buf = bytearray(header.tostring() + body.tostring()) return java_instance.jvm.my.namespace.MyClass.createFromPy4j(buf) 指令可以有几个特定于与套接字相关的系统调用的附加参数。这些参数可以在任何listen指令中指定,但对于给定的 listen 对,只能

因此,您应该只使用address:port一次,但它对于收听同一accept_filter=httpready的所有服务器块都有效。