惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
The Register - Security
The Register - Security
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
P
Proofpoint News Feed
Project Zero
Project Zero
The GitHub Blog
The GitHub Blog
The Last Watchdog
The Last Watchdog
F
Fortinet All Blogs
S
Schneier on Security
Help Net Security
Help Net Security
Security Archives - TechRepublic
Security Archives - TechRepublic
C
Check Point Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
I
InfoQ
T
The Blog of Author Tim Ferriss
Cisco Talos Blog
Cisco Talos Blog
Stack Overflow Blog
Stack Overflow Blog
T
Troy Hunt's Blog
人人都是产品经理
人人都是产品经理
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cyber Attacks, Cyber Crime and Cyber Security
雷峰网
雷峰网
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿
Forbes - Security
Forbes - Security
Vercel News
Vercel News
S
Security Affairs
美团技术团队
P
Privacy & Cybersecurity Law Blog
N
News and Events Feed by Topic
Cyberwarzone
Cyberwarzone
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Spread Privacy
Spread Privacy
Attack and Defense Labs
Attack and Defense Labs
IT之家
IT之家
U
Unit 42
Recorded Future
Recorded Future
W
WeLiveSecurity
PCI Perspectives
PCI Perspectives
P
Palo Alto Networks Blog
H
Hacker News: Front Page
S
Security @ Cisco Blogs
博客园 - 【当耐特】

nginx on 打工人日志

使用TLSv1.3 升级nginx和openssl nginx 配置和编译 nginx ssh-key connection exception nginx 编译参数详解 nginx 重写规则 rewrite模块 nginx 日志格式整理 nginx 汇总
nginx.conf 配置文件详解
2021-12-24 · via nginx on 打工人日志

nginx.conf 配置文件详解

 1# vim nginx.conf
 2user nobody nobody; # 运行 nginx 的所属组和所有者
 3worker_processes 2; # 开启两个 nginx 工作进程,一般几个 CPU 核心就写几
 4error_log logs/error.log notice; # 错误日志路径
 5pid logs/nginx.pid; # pid 路径
 6
 7events
 8{
 9    worker_connections 1024; # 一个进程能同时处理 1024 个请求
10}
11
12http
13{
14    include mime.types;
15    default_type application/octet-stream;
16
17    log_format main ‘$remote_addr$remote_user [$time_local]$request” ‘
18$status $body_bytes_sent$http_referer” ‘
19    ‘”$http_user_agent” “$http_x_forwarded_for”‘;
20    access_log logs/access.log main; # 默认访问日志路径
21    sendfile on;
22    keepalive_timeout 65; # keepalive 超市时间
23    # 开始配置一个域名,一个 server 配置段一般对应一个域名
24    server
25    {
26        listen 80; #
27        # 在本机所有 ip 上监听 80,也可以写为 192.168.1.202:80,这样的话,就只监听 192.168.1.202 上的 80 口
28        server_name www.nbtyfood.com; # 域名
29        root /www/html/www.nbtyfood.com; # 站点根目录(程序目录)
30        index index.html index.htm; # 索引文件
31        location /
32        { # 可以有多个 location
33            root /www/html/www.nbtyfood.com; # 站点根目录(程序目录)
34        }
35        error_page 500 502 503 504 /50x.html;
36        # 定义错误页面,如果是 500 错误,则把站点根目录下的 50x.html 返回给用户
37        location = /50x.html {
38        root /www/html/www.nbtyfood.com;
39        }
40    }
41# 开始配置站点 bbs.nbtyfood.com
42    server
43    {
44        listen 80;
45        server_name bbs.nbtyfood.com;
46        root /www/html/bbs.nbtyfood.com;
47        index index.html index.htm; # 索引文件
48        location /
49        {
50            root /www/html/bbs.nbtyfood.com;
51        }
52        error_page 500 502 503 504 /50x.html;
53        location = /50x.html {
54            root /www/html/bbs.nbtyfood.com;
55        }
56    }
57}