nginx.conf 配置文件中文说明

###############################nginx.conf 配置文件中文说明
#user  nobody;                  # user 主模块指令,指令nginx worker 运行用户和用户组(user xxxuser xxxgroup) ,默认由nobody运行
worker_processes  1;            # worker_processes 主模块指令,指令nginx运行进程数,每个进程平均耗10m-12m内存,单核为1,多核为n

#error_log  logs/error.log;     # 全局日志 输出级别debug,info,notice,warn,error,crit ,其中debug输出日志最为详细
#error_log  logs/error.log  notice; #级别 notice
#error_log  logs/error.log  info;   #级别 info

#pid        logs/nginx.pid;     #pid 指令  指定进程id存储位置

events {
    worker_connections  1024;   #events 指令 指令nginx 工作模式和连接数上限
}

http {                                  #http服务器配置
    include       mime.types;           #包含文件mime.types
    default_type  application/octet-stream;  #默认为二进制流

    #日志格式的设定
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '  #HttpLog模块指令,日志输出格式,main为日志名称,可以在access_log指令引用
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;   #高效文件传输模式,将tcp_nopush和tcp_nodely设置为on
    #tcp_nopush     on;

    #keepalive_timeout  0;  #客户端连接保持活动的超时时间,超时后关闭连接
    keepalive_timeout  65;       

    #gzip  on;  #开启gzip压缩  实时压缩输出数据流

    #server虚拟主机配置
    server {
        listen       80;  #端口
        server_name  localhost; #ip或域名,可以多个www.abc.com,127.0.0.1

        #charset koi8-r;   #编码格式

        #access_log  logs/host.access.log  main;   #虚拟主机访问日志存放路径

        location / {
            root   html;
            index  index.html index.htm;
        }

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        #location ~ \.php$ {
        #    proxy_pass   http://127.0.0.1;
        #}

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #
        #location ~ \.php$ {
        #    root           html;
        #    fastcgi_pass   127.0.0.1:9000;
        #    fastcgi_index  index.php;
        #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
        #}

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one
        #
        #location ~ /\.ht {
        #    deny  all;
        #}
    }

    # another virtual host using mix of IP-, name-, and port-based configuration
    #
    #server {
    #    listen       8000;
    #    listen       somename:8080;
    #    server_name  somename  alias  another.alias;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

    # HTTPS server
    #
    #server {
    #    listen       443;
    #    server_name  localhost;

    #    ssl                  on;
    #    ssl_certificate      cert.pem;
    #    ssl_certificate_key  cert.key;

    #    ssl_session_timeout  5m;

    #    ssl_protocols  SSLv2 SSLv3 TLSv1;
    #    ssl_ciphers  HIGH:!aNULL:!MD5;
    #    ssl_prefer_server_ciphers   on;

    #    location / {
    #        root   html;
    #        index  index.html index.htm;
    #    }
    #}

}

nginx.conf 配置文件中文说明

时间: 2024-08-29 07:58:22

nginx.conf 配置文件中文说明的相关文章

Nginx的nginx.conf配置文件中文注释说明

#运行用户    user www-data;        #启动进程,通常设置成和cpu的数量相等    worker_processes  1;    #全局错误日志及PID文件    error_log  /var/log/nginx/error.log;    pid        /var/run/nginx.pid;    #工作模式及连接数上限    events {        use   epoll;             #epoll是多路复用IO(I/O Multip

Nginx(三):nginx.conf配置文件说明 【2】 文件结构和配置高亮

配置文件结构说明: 里面的配置文件有几个,当然最主要是nginx.conf配置文件. Main配置段,是核心配置段. Events { 配置事件的 } Http { } 标准http配置段,可选http配置段,都在http{}这里配置,每一种都是一个独立的. 注意:每一个配置参数都需要以分号结尾 标准模块也叫作核心模块是默认都安装的,如果不想安装就是-without什么,可选模块是默认不安装的,如果想安装就是-with-什么 可选模块比如-with-http_ssl_module和-with-h

nginx搭建的cdn服务器的nginx.conf配置文件

默认的nginx.conf配置文件 worker_processes 1; events { worker_connections 1024; } http { access_log off; client_body_temp_path temp/client_body_temp; fastcgi_temp_path temp/fastcgi_temp; scgi_temp_path temp/scgi_temp; uwsgi_temp_path temp/uwsgi_temp; proxy_t

[原]生产环境下的nginx.conf配置文件(多虚拟主机)

[原]生产环境下的nginx.conf配置文件(多虚拟主机) 2013-12-27阅读110 评论0 我的生产环境下的nginx.conf配置文件,做了虚拟主机设置的,大家可以根据需求更改,下载即可在自己的机器上使用了,本配置文件摘录自<构建高可用Linux服务器>(机械工业出版社),转载麻烦注明出处,谢谢,配置文件如下: user  www www;worker_processes 8;error_log  /data/logs/nginx_error.log  crit;pid      

nginx.conf配置文件分析

#总结一下nginx.conf文件内容. #运行用户 user www-data; #启动进程,通常设置成和cpu的数量相等 worker_processes  1; #全局错误日志 error_log  /var/log/nginx/error.log; #进程文件 pid        /var/run/nginx.pid; #一个nginx进程打开的最多文件描述符数目,理论值应该是最多打开文件数(系统的值ulimit -n)与nginx进程数相除,但是nginx分配请求并不均匀,所以建议与

nginx.conf配置文件解析(http、server、location proxy_pass)

nginx.conf配置文件解析(http.server.location) 标签: nginxnginx-conf 2017-04-26 20:10 1031人阅读 评论(0) 收藏 举报 分类: Nginx(8) 版权声明:本文为博主原创文章,未经博主允许不得转载. nginx.conf文件在安装目录/conf目录下 1.定义Nginx运行的用户和用户组 user nginx nginx; 2.nginx进程数,建议设置为等于CPU总核心数 worker_processes 1; 3.全局错

Nginx(二)------nginx.conf 配置文件

上一篇博客我们将 nginx 安装在 /usr/local/nginx 目录下,其默认的配置文件都放在这个目录的 conf 目录下,而主配置文件 nginx.conf 也在其中,后续对 nginx 的使用基本上都是对此配置文件进行相应的修改,所以本篇博客我们先大致介绍一下该配置文件的结构. 1.nginx.conf 的主体结构 打开此文件,内容如下: 1 #user nobody; 2 worker_processes 1; 3 4 #error_log logs/error.log; 5 #e

01_Nginx安装,nginx下部署项目,nginx.conf配置文件修改,相关文件配置

?? 1.下载Nginx,进入Nginx下载地址:http://nginx.org/ 点击nginx-1.8.0,进入:http://nginx.org/en/download.html,下载文件: 2 下载pcre,这个是一个正则表达式的库,Nginx做rewriter的时候回用到这个库: 进入pcre的官网(rewrite模式需要pcre):http://www.pcre.org/ 选中右击复制所需要的版本: 3 下载zlib库(gzip模块需要zlib):http://www.zlib.n

nginx.conf配置文件里的upstream加入健康检查

查看NGINX启用了那些模块: # ./nginx -V Tengine version: Tengine/2.1.1 (nginx/1.6.2) built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) TLS SNI support enabled configure arguments: --prefix=/apps/tengine-2.1.1 loaded modules: ngx_core_module (static) ngx_errl