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

推荐订阅源

T
Tenable Blog
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
H
Help Net Security
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
宝玉的分享
宝玉的分享
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 司徒正美
量子位
N
Netflix TechBlog - Medium
Apple Machine Learning Research
Apple Machine Learning Research
小众软件
小众软件
Recorded Future
Recorded Future
博客园 - 三生石上(FineUI控件)
Vercel News
Vercel News
aimingoo的专栏
aimingoo的专栏
I
InfoQ
Microsoft Security Blog
Microsoft Security Blog
Scott Helme
Scott Helme
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
IT之家
IT之家
AI
AI
WordPress大学
WordPress大学
Security Archives - TechRepublic
Security Archives - TechRepublic
Google Online Security Blog
Google Online Security Blog
U
Unit 42
V2EX - 技术
V2EX - 技术
MongoDB | Blog
MongoDB | Blog
Schneier on Security
Schneier on Security
博客园 - Franky
H
Heimdal Security Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Jina AI
Jina AI
W
WeLiveSecurity
P
Privacy & Cybersecurity Law Blog
Cloudbric
Cloudbric
B
Blog RSS Feed
N
News | PayPal Newsroom
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
I
Intezer
Hacker News - Newest:
Hacker News - Newest: "LLM"
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园_首页
罗磊的独立博客
H
Hackread – Cybersecurity News, Data Breaches, AI and More
雷峰网
雷峰网

linux on 打工人日志

使用TLSv1.3 升级nginx和openssl nginx 配置和编译 nginx ssh-key connection exception centos7.9 网络配置 nginx 编译参数详解 nginx 重写规则 rewrite模块 nginx 日志格式整理 linux系统开启root权限 nginx 汇总
nginx.conf 配置文件详解
2021-12-24 · via linux 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}