-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
183 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
# NGINX | ||
|
||
## 在既有 nginx 上增加编译 http2 模块 | ||
|
||
参考自:[既有 Nginx 不停服重新动态编译增加 http2.0 模块](https://www.cnblogs.com/surging-dandelion/p/14378073.html) | ||
|
||
```sh | ||
nginx -V | ||
``` | ||
|
||
复制 `configure arguments`,增加 `--with-http_v2_module` | ||
|
||
```sh | ||
./configure --prefix=/usr/local/nginx-1.24.0 --user=root --with-http_ssl_module --with-http_stub_status_module --with-http_v2_module | ||
``` | ||
|
||
只 make 不 install | ||
|
||
```sh | ||
make | ||
``` | ||
|
||
make 过后在编译目录 下 objs 中生成新的 nginx 执行文件 | ||
|
||
备份 ./sbin 下的 nginx | ||
|
||
```sh | ||
mv sbin/nginx sbin/nginx-without-h2.bak | ||
``` | ||
|
||
将新编译的 nginx 执行文件拷贝到原执行文件的位置 | ||
|
||
```sh | ||
cp objs/nginx sbin/nginx | ||
``` | ||
|
||
查看现有 nginx 快捷运行命令 | ||
|
||
```sh | ||
whereis nginx | ||
``` | ||
|
||
备份现有 nginx 快捷运行命令 | ||
|
||
```sh | ||
mv /usr/local/bin/nginx /usr/local/bin/nginx-without-h2.bak | ||
``` | ||
|
||
拷贝 nginx 运行命令,快捷运行 | ||
|
||
```sh | ||
cp sbin/nginx /usr/local/bin/ | ||
``` | ||
|
||
编辑 nginx.conf | ||
|
||
```sh | ||
listen 443 ssl http2; | ||
``` | ||
|
||
重启 nginx | ||
|
||
```sh | ||
nginx -t | ||
# 必须 stop、不能 reload | ||
nginx -s stop | ||
nginx | ||
``` | ||
|
||
## 强制协商缓存 index.html | ||
|
||
```nginx.conf | ||
location / { | ||
root D:/Softs/nginx-1.23.4/html/dist; | ||
try_files $uri $uri/ /index.html; | ||
index index.html; | ||
# ++++++++ | ||
if ($request_filename ~* .*index\.(html)$){ | ||
add_header Cache-Control "no-cache"; | ||
} | ||
} | ||
``` | ||
|
||
## root 与 alias 的区别 | ||
|
||
## proxy_pass 后有无 `"/"` 的区别 | ||
|
||
## 开启同源策略 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# 抓包 | ||
|
||
## Fiddler | ||
|
||
## Wireshark |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.