Blogger Information
Blog 16
fans 0
comment 0
visits 14630
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
虚拟主机配置及location
进击的小菜鸟
Original
661 people have browsed it

//全局区

worker_processes;//有一个工作的子进程,可以自行修改,但太大无益,因为要争夺cpu,一般设置为cpu数*核数

Event{

//一般是配置nginx连接的特性

//如1个work能同时允许多少连接

worker_connections 1024;//指一个子进程最大允许连1024个连接

}

http{//这是配置http服务器的主要段

server{

    listen 80;//监听的端口

    server_name z.com;//监听的域名或者ip

    location / {

        root z.com;//相对与nginx根目录的路径或者绝对路径

        index index.html;//默认访问的文件 

}

}

location分为

精准匹配  =xxx

普通匹配 xxx

正则匹配 ~xxx

location命中过程

1:先判断精准命中  如果命中,立即返回结果并结束解析

2:判断普通命中,如果有多个命中,记录下来最长的命中结果

3:继续判断正则表达式的解析结果,按配置里的正则表达式顺序为准

   ,由上到下开始匹配,一旦匹配成功一个,立即返回结果并结束解析


Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!