zoukankan      html  css  js  c++  java
  • 【个人笔记】跟着官方文档学nginx——Basic Functionality基础功能

    有点尴尬,官方文档看错地方了,真正的官方文档在https://docs.nginx.com/nginx/admin-guide/basic-functionality/runtime-control/

    基础功能分为两部分

    Controlling NGINX Processes at Runtime——移步https://www.cnblogs.com/haon/p/10962160.html

    Creating NGINX Plus and NGINX Configuration Files——移步https://www.cnblogs.com/haon/p/10961838.html

    本文将对nginx.conf 更细致的讲解

    开始

    nginx.conf 分为三个部分

    Directives指令

    普通指令如:

    user             nobody;
    error_log        logs/error.log notice;
    worker_processes 1;

    Feature-Specific Configuration Files 特殊配置文件

    推荐分割,保存在/etc/nginx/conf.d下,用include加载内容

    ex:

    include conf.d/http;
    include conf.d/stream;
    include conf.d/exchange-enhanced;

    这里我看不懂,保存的啥,include取的啥

    Contexts 内容主体

    根据通信种类不同分为

    针对一种通信方式可以有多个server指令块(虚拟服务器),通信方式决定server内的可用指令

    user nobody; # a directive in the 'main' context
    
    events {
        # configuration of connection processing
    }
    
    http {
        # Configuration specific to HTTP and affecting all virtual servers  
    
        server {
            # configuration of HTTP virtual server 1       
            location /one {
                # configuration for processing URIs starting with '/one'
            }
            location /two {
                # configuration for processing URIs starting with '/two'
            }
        } 
        
        server {
            # configuration of HTTP virtual server 2
        }
    }
    
    stream {
        # Configuration specific to TCP/UDP and affecting all virtual servers
        server {
            # configuration of TCP virtual server 1 
        }
    }

    这里还讲了嵌套context的情况,没看懂,先保留

    Inheritance

    In general, a child context – one contained within another context (its parent) – inherits the settings of directives included at the parent level. Some directives can appear in multiple contexts, in which case you can override the setting inherited from the parent by including the directive in the child context. For an example, see the proxy_set_header directive.

  • 相关阅读:
    andorid自己定义ViewPager之——子ViewPager滑到边缘后直接滑动父ViewPager
    MTK Camera驱动移植
    云计算VDI相关职位招聘
    Android内存泄露之开篇
    关于ping以及TTL的分析
    STL之关联容器的映射底层
    STL非变易算法
    自己主动更新 -- 版本比較(2)
    activiti自己定义流程之Spring整合activiti-modeler5.16实例(四):部署流程定义
    合并多个文本文件方法
  • 原文地址:https://www.cnblogs.com/haon/p/10962329.html
Copyright © 2011-2022 走看看