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

推荐订阅源

T
The Blog of Author Tim Ferriss
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
云风的 BLOG
云风的 BLOG
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
P
Palo Alto Networks Blog
D
Docker
H
Hackread – Cybersecurity News, Data Breaches, AI and More
S
Schneier on Security
Engineering at Meta
Engineering at Meta
I
InfoQ
L
LangChain Blog
Cyberwarzone
Cyberwarzone
T
Tenable Blog
WordPress大学
WordPress大学
P
Privacy & Cybersecurity Law Blog
罗磊的独立博客
Apple Machine Learning Research
Apple Machine Learning Research
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Jina AI
Jina AI
C
CERT Recently Published Vulnerability Notes
Scott Helme
Scott Helme
博客园 - 三生石上(FineUI控件)
酷 壳 – CoolShell
酷 壳 – CoolShell
Know Your Adversary
Know Your Adversary
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Last Watchdog
The Last Watchdog
Last Week in AI
Last Week in AI
Cloudbric
Cloudbric
S
SegmentFault 最新的问题
爱范儿
爱范儿
Application and Cybersecurity Blog
Application and Cybersecurity Blog
博客园 - 叶小钗
AI
AI
T
Tor Project blog
I
Intezer
T
Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
N
News and Events Feed by Topic
Latest news
Latest news
S
Security Affairs
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
B
Blog RSS Feed
C
Cybersecurity and Infrastructure Security Agency CISA
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
S
Securelist

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}