zoukankan      html  css  js  c++  java
  • Nginx默认配置语法

    Nginx默认配置语法

    1. 我们进入  /etc/nginx/目录下,打开  nginx.conf文件


    2. 我们来解析下 这里面标签和各模块的作用
    # 设置nginx服务的系统使用用户
    user  nginx;
    # 设置工作进程数,一般设置为 主机的cpu数量
    worker_processes  1;
    # 有关nginx错误日志的目录文件
    error_log  /var/log/nginx/error.log warn;
    # nginx启动时候pid
    pid        /var/run/nginx.pid;
    
    
    events {
    	# 每个进程允许的最大连接数
        worker_connections  1024;
    }
    
    
    http {
        include       /etc/nginx/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  /var/log/nginx/access.log  main;
    
    	
        sendfile        on;
        #tcp_nopush     on;
    
        #设置客户端和服务端的超时时间为 65秒
        keepalive_timeout  65;
    
        #gzip  on;
    
        include /etc/nginx/conf.d/*.conf;
    }
    



  • 相关阅读:
    Mac 配置前端基本环境
    sass安装 使用
    SVG
    css规范
    [转载] Solaris命令使用
    solaris 10 基本使用
    dos taskkill 命令
    servicemix-3.2.1 内置的服务引擎和绑定组件
    servicemix-3.2.1 部署异常
    解析XML内容到User对象
  • 原文地址:https://www.cnblogs.com/duguxiaobiao/p/9128812.html
Copyright © 2011-2022 走看看