Skip to content

Commit

Permalink
nginx架构和安装
Browse files Browse the repository at this point in the history
  • Loading branch information
ShayZhu1024 committed Jul 3, 2024
1 parent 50f2fae commit eefb598
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions nginx/4.nginx的核心模块.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,32 @@ http {
}
}


include       mime.types; #导入支持的文件类型,是相对于/apps/nginx/conf的目录
default_type application/octet-stream; #除mime.types中文件类型外,设置其它文件默认类型,访问其它类型时会提示下载不匹配的类型文件
sendfile       on;
tcp_nopush     on; #开启sendfile的情况下,合并请求后统一发送给客户端,必须开启sendfile
tcp_nodelay   off; #开启keepalived模式下的连接是否启用TCP_NODELAY选项,为off时,延迟0.2s发送,默认On时,不延迟发送,立即发送用户响应报文
keepalive_timeout  65 65; #设置会话保持时间,第二个值为响应首部:keepAlived:timeout=65,可以和第一个值不同
```
## server 配置块
```bash
server {
  listen       80 default_server; #设置监听地址和端口,多个虚拟机时当前是否是默认的虚拟主机,default_server表示是默认主机,否则排在前面server为默认主机
  server_name localhost; #设置server name,可以以空格隔开写多个并支持正则表达式,如:*.wang.com www.wang.* ~^www\d+\.wang\.com$
  charset koi8-r; #设置编码格式,默认是俄语格式,建议改为utf-8
  access_log logs/host.access.log main;
  location / {
      root   html;
      index index.html index.htm;
}

```
Expand Down

0 comments on commit eefb598

Please sign in to comment.