当前位置:首页  电脑知识  系统

nginx绑定大量域名时需要修改的两个参数

nginx绑定大量域名时需要修改的两个参数

日期:2025-03-17 09:13:03来源:捷维科技浏览:

nginx绑定大量域名时需要修改的两个参数

nginx: [warn] could not build optimal server_names_hash, you should increase either server_names_hash_max_size: 512 or server_names_hash_bucket_size: 64; ignoring server_names_hash_bucket_size

 

http {

    include       mime.types;

    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

                      '$status $body_bytes_sent "$http_referer" '

                      '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;

    #tcp_nopush     on;

    #keepalive_timeout  0;

    keepalive_timeout  65;

    #gzip  on;

    # 添加或修改下面2行

    server_names_hash_max_size 4096;

    server_names_hash_bucket_size 1024;

    include vhost/*.conf;

}

返回列表:下一篇
相关推荐