update
This commit is contained in:
parent
997d8a0ac9
commit
86542c0689
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
##### 安装编译环境
|
##### 安装编译环境
|
||||||
|
|
||||||
```
|
```bash
|
||||||
#GCC
|
#GCC
|
||||||
apt install -y build-essential
|
apt install -y build-essential
|
||||||
|
|
||||||
@ -59,7 +59,7 @@ https://nginx.org/download/nginx-1.22.0.tar.gz
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
```bash
|
||||||
./configure \
|
./configure \
|
||||||
--prefix=/usr/local/nginx \
|
--prefix=/usr/local/nginx \
|
||||||
--user=www \
|
--user=www \
|
||||||
@ -170,7 +170,7 @@ curl 127.0.0.1
|
|||||||
|
|
||||||
加到 http 节点中
|
加到 http 节点中
|
||||||
|
|
||||||
```
|
```nginx
|
||||||
include mime.types;
|
include mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
|
|
||||||
@ -261,7 +261,7 @@ curl 127.0.0.1
|
|||||||
|
|
||||||
#### 附1: `systemctl 操作`
|
#### 附1: `systemctl 操作`
|
||||||
|
|
||||||
```
|
```bash
|
||||||
#重载配置文件 添加新的 或者修改都要重载。
|
#重载配置文件 添加新的 或者修改都要重载。
|
||||||
systemctl daemon-reload
|
systemctl daemon-reload
|
||||||
|
|
||||||
@ -334,7 +334,7 @@ curl 127.0.0.1
|
|||||||
|
|
||||||
apt 卸载nginx
|
apt 卸载nginx
|
||||||
|
|
||||||
```
|
```bash
|
||||||
查询 nginx 相关软件
|
查询 nginx 相关软件
|
||||||
|
|
||||||
dpkg --get-selections|grep nginx
|
dpkg --get-selections|grep nginx
|
||||||
@ -352,8 +352,7 @@ apt-get --purge remove nginx
|
|||||||
###### nginx.conf
|
###### nginx.conf
|
||||||
|
|
||||||
```nginx
|
```nginx
|
||||||
|
worker_processes auto;
|
||||||
worker_processes auto;
|
|
||||||
|
|
||||||
worker_rlimit_nofile 51200;
|
worker_rlimit_nofile 51200;
|
||||||
|
|
||||||
@ -368,55 +367,54 @@ stream {
|
|||||||
|
|
||||||
|
|
||||||
events {
|
events {
|
||||||
use epoll;
|
use epoll;
|
||||||
worker_connections 51200;
|
worker_connections 51200;
|
||||||
multi_accept on;
|
multi_accept on;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
http {
|
http {
|
||||||
include mime.types;
|
include mime.types;
|
||||||
default_type application/octet-stream;
|
default_type application/octet-stream;
|
||||||
|
|
||||||
server_names_hash_bucket_size 512;
|
server_names_hash_bucket_size 512;
|
||||||
client_header_buffer_size 32k;
|
client_header_buffer_size 32k;
|
||||||
large_client_header_buffers 4 32k;
|
large_client_header_buffers 4 32k;
|
||||||
client_max_body_size 50m;
|
client_max_body_size 50m;
|
||||||
|
|
||||||
sendfile on;
|
sendfile on;
|
||||||
tcp_nopush on;
|
tcp_nopush on;
|
||||||
|
|
||||||
keepalive_timeout 60;
|
keepalive_timeout 60;
|
||||||
|
|
||||||
tcp_nodelay on;
|
tcp_nodelay on;
|
||||||
|
|
||||||
fastcgi_connect_timeout 300;
|
fastcgi_connect_timeout 300;
|
||||||
fastcgi_send_timeout 300;
|
fastcgi_send_timeout 300;
|
||||||
fastcgi_read_timeout 300;
|
fastcgi_read_timeout 300;
|
||||||
fastcgi_buffer_size 64k;
|
fastcgi_buffer_size 64k;
|
||||||
fastcgi_buffers 4 64k;
|
fastcgi_buffers 4 64k;
|
||||||
fastcgi_busy_buffers_size 128k;
|
fastcgi_busy_buffers_size 128k;
|
||||||
fastcgi_temp_file_write_size 256k;
|
fastcgi_temp_file_write_size 256k;
|
||||||
fastcgi_intercept_errors on;
|
fastcgi_intercept_errors on;
|
||||||
|
|
||||||
gzip on;
|
gzip on;
|
||||||
gzip_min_length 1k;
|
gzip_min_length 1k;
|
||||||
gzip_buffers 4 16k;
|
gzip_buffers 4 16k;
|
||||||
gzip_http_version 1.1;
|
gzip_http_version 1.1;
|
||||||
gzip_comp_level 2;
|
gzip_comp_level 2;
|
||||||
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
|
gzip_types text/plain application/javascript application/x-javascript text/javascript text/css application/xml;
|
||||||
gzip_vary on;
|
gzip_vary on;
|
||||||
gzip_proxied expired no-cache no-store private auth;
|
gzip_proxied expired no-cache no-store private auth;
|
||||||
gzip_disable "MSIE [1-6]\.";
|
gzip_disable "MSIE [1-6]\.";
|
||||||
|
|
||||||
limit_conn_zone $binary_remote_addr zone=perip:10m;
|
limit_conn_zone $binary_remote_addr zone=perip:10m;
|
||||||
limit_conn_zone $server_name zone=perserver:10m;
|
limit_conn_zone $server_name zone=perserver:10m;
|
||||||
|
|
||||||
server_tokens off;
|
server_tokens off;
|
||||||
access_log off;
|
access_log off;
|
||||||
|
|
||||||
|
include /etc/nginx/site-enable/*.conf;
|
||||||
include /etc/nginx/site-enable/*.conf;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
@ -425,7 +423,7 @@ http {
|
|||||||
|
|
||||||
###### web-site.conf
|
###### web-site.conf
|
||||||
|
|
||||||
```
|
```nginx
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
server_name frp.plugin.dr1997.com;
|
server_name frp.plugin.dr1997.com;
|
||||||
@ -450,7 +448,7 @@ server {
|
|||||||
|
|
||||||
###### ssl
|
###### ssl
|
||||||
|
|
||||||
```
|
```nginx
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen 443 ssl http2;
|
listen 443 ssl http2;
|
||||||
@ -490,7 +488,7 @@ server {
|
|||||||
|
|
||||||
###### 反向代理(http)
|
###### 反向代理(http)
|
||||||
|
|
||||||
```
|
```nginx
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
listen 443 ssl http2;
|
listen 443 ssl http2;
|
||||||
@ -533,7 +531,7 @@ server {
|
|||||||
|
|
||||||
###### 反向代理 tcn
|
###### 反向代理 tcn
|
||||||
|
|
||||||
```
|
```nginx
|
||||||
upstream tcp {
|
upstream tcp {
|
||||||
server 127.0.0.1:3306;
|
server 127.0.0.1:3306;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user