nginx 配置文件

默認(rèn)配置項(xiàng)

user www-data;  //nginx賬戶
worker_processes auto; //允許開啟的worker的數(shù)量 
pid /run/nginx.pid; //配置pid的路徑
include /etc/nginx/modules-enabled/*.conf;  // include 引入文件
//不同進(jìn)程的配置
events {
        worker_connections 768; //每個(gè)進(jìn)程支持的并發(fā)數(shù)
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on; // 是否讓nginx調(diào)用系統(tǒng)的sendfile函數(shù)
        tcp_nopush on; //是否讓數(shù)據(jù)包累計(jì)進(jìn)行傳輸
        tcp_nodelay on;// 最小數(shù)據(jù)包是否等待然后繼續(xù)傳輸
        keepalive_timeout 65; //請(qǐng)求超時(shí)時(shí)間
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types; // 引入文件類型枚舉的文件
        default_type application/octet-stream; //如果是不在文件枚舉類型中統(tǒng)一以application 二進(jìn)制流做返回

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##
      
        access_log /var/log/nginx/access.log; //日志路徑
        error_log /var/log/nginx/error.log;//錯(cuò)誤日志路徑

        ##
        # Gzip Settings
        ##

        gzip on;

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*; //關(guān)于端口訪問的配置
}


#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
#
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容