Nginx配置以及热升级
Nginx详解
Nginx与Apache一样,都是web服务器,但是Nginx比Apache多一些功能,比如Nginx可以做代理,可以做负载均衡……
1. Nginx关键特性
- 支持高并发
- 单机Nginx可支持十万级别的并发连接,经过优化后可支持百万级别并发
- 内存资源消耗低
- 在同级web中,Nginx占用的内存最少,一万非活跃的http长连接仅消耗2.5M内存
- 高扩展性
- 和Apache一样,Nginx采用模块化设计,并支持非常多丰富的第三方模块
- 高可靠性
- Nginx采用master-worker模式,如果worker出现故障,master可以快速开启一个新的worker来提供服务
2. Nginx配置
[root@ceph conf.d]# grep -Ev "^#|^$|#" /etc/nginx/nginx.conf |cat -n
1 user nginx;
2 worker_processes auto;
3 error_log /var/log/nginx/error.log;
4 pid /run/nginx.pid;
5 include /usr/share/nginx/modules/*.conf;
6 events {
7 worker_connections 1024;
8 }
9 http {
10 log_format main '$remote_addr - $remote_user [$time_local] "$request" '
11 '$status $body_bytes_sent "$http_referer" '
12 '"$http_user_agent" "$http_x_forwarded_for"';
13 access_log /var/log/nginx/access.log main;
14 sendfile on;
15 tcp_nopush on;
16 tcp_nodelay on;
17 keepalive_timeout 65;
18 types_hash_max_size 4096;
19 include /etc/nginx/mime.types;
20 default_type application/octet-stream;
21 include /etc/nginx/conf.d/*.conf;
22 server {
23 listen 80;
24 listen [::]:80;
25 server_name _;
26 root /usr/share/nginx/html;
27 include /etc/nginx/default.d/*.conf;
28 error_page 404 /404.html;
29 location = /40x.html {
30 }
31 error_page 500 502 503 504 /50x.html;
32 location = /50x.html {
33 }
34 }
35 }
由于之前很详细的写过Apache的配置了,这里就说一下这俩服务之间的差异,nginx的配置文件每行配置结束必须以分号;结尾
- Nginx也可以配置启动的用户,默认为nginx,可以修改
- Nginx工作进程,默认为auto(与CPU核心数保持一致),也可以手动修改
- 定义nginx的错误日志
这两个都是Apache服务里面也有的,这里就简答说一下
2.1 event
第六行event这个是指定nginx的工作模式,默认的,Apache也有这个模式,这个段落里面的内容
events {
worker_connections 1024; 指定单个进程的连接数
}
2.2 http
这个段落里面就是一些http的配置
2.2.1 log_format
首先就是定义日志的格式log_format,然后就是access.log这个就不细写
2.2.2 sendfile
sendfile on;这个代表高效传输,也就是可以将文件直接从磁盘传输到网络中,而不先读到内存
2.2.3 tcp_nopush
tcp_nopush on 立刻回应tcp的请求
2.2.4 tcp_nodelay
tcp_nodelay on 对于小数据包直接回应
2.2.5 keepalive_timeout
keepalive_timeout 65,这个通过名字就可以知道,是长连接的超时时间
2.2.6 include
我跳过了types_hash_max_size,这个是hash散列表,我也不知道是干嘛的
include /etc/nginx/mime.types; 这里是载入nginx能够识别的类型,你可以打开这个文件去看这里面都定义了什么,打开就一目了然了
2.2.7 default_type
default_type application/octet-stream; 二进制的文件可以直接下载
2.2.8 server
server {
listen 80;
listen [::]:80;
server_name _;
root /usr/share/nginx/html;
include /etc/nginx/default.d/*.conf;
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
}
这里的server对应的就是Apache的虚拟主机
listen 监听的端口,他这里默认监听了2个,一个是IPv4,另一个是IPv6
server_name:对外提供的服务名,也就是域名
root:网站根目录
include: 定义虚拟主机的特性,可以将一些其他的特性卸载conf.d/下之后他会自动加载配置
error_page 404 :这个是错误页,当404出现的时候,nginx会返回网站根目录下的404.html
locatioin: 这个是nginx的重头戏,叫做路由规则,你可以将路由策略写在这,他就会根据你的策略来处理流量,这个我们稍后细讲
error_page 500当服务发生500以上的错误的时候,nginx返回网站根目录下的50x.html
3. 配置Nginx虚拟主机
Nginx也支持3种虚拟主机,与Apache一样
- 基于端口的虚拟主机
- 基于IP的虚拟主机
- 基于域名的虚拟主机
3.1 基于端口
虚拟主机我们可以在conf.d下进行配置
[root@ceph conf.d]# vim virthost.conf
server {
listen 81;
root /web1;
}
server {
listen 82;
root /web2;
}
[root@ceph conf.d]# echo 81 > /web1/index.html
[root@ceph conf.d]# echo 82 > /web2/index.html
[root@ceph conf.d]# systemctl restart nginx
[root@ceph conf.d]# curl localhost:82
82
[root@ceph conf.d]# curl localhost:81
81
基于端口的虚拟主机这样就配好了
3.2 基于IP
首先配置一个临时IP
[root@ceph conf.d]# sudo ip addr add 192.168.1.100/24 dev ens33
[root@ceph conf.d]# ip a |grep 192.168.1.100
inet 192.168.1.100/24 scope global ens33
虚拟的IP就配置好了,接下来配置nginx
[root@ceph conf.d]# vim virthost.conf
server {
listen 81;
root /web1;
}
server {
listen 82;
root /web2;
}
server {
listen 192.168.200.210:80;
root /web3;
}
server {
listen 192.168.1.100:80;
root /web4;
}
然后我们创建对应的网站根目录以及index.html
[root@ceph conf.d]# echo 192.168.200.210 > /web3/index.html
[root@ceph conf.d]# echo 192.168.1.100 > /web4/index.html
[root@ceph conf.d]# systemctl restart nginx
[root@ceph conf.d]# curl 192.168.200.210
192.168.200.210
[root@ceph conf.d]# curl 192.168.1.100
192.168.1.100
可以看到,通过不同的ip访问回显是不同的内容
3.3 基于域名
[root@ceph conf.d]# vim virthost.conf
server {
listen 80;
server_name test.com;
root /web5;
}
server {
listen 80;
server_name example.com;
root /web6;
}
创建根目录以及重启服务,还需要做hosts解析
[root@ceph conf.d]# echo web5 > /web5/index.html
[root@ceph conf.d]# echo web6 > /web6/index.html
[root@ceph conf.d]# systemctl restart nginx
[root@ceph conf.d]# vim /etc/hosts
192.168.200.210 test.com
192.168.200.210 example.com
[root@ceph conf.d]# curl test.com
web5
[root@ceph conf.d]# curl example.com
web6
这样也是可以访问到对应的文件的
4. Location
这个是nginx最重要的配置了,在Apache里面访问控制是用Directory
和Files
来做的,那么在nginx里面的做法就是location了
4.1 拒绝访问
我不想你访问网站根目录下的/test.html,那么我的路由规则就应该这样写,还是在虚拟主机里定义
[root@ceph conf.d]# vim virthost.conf
server {
listen 80;
server_name test.com;
root /web5;
location /test.html {
return 403;
}
}
我们来创建这个test.html文件,并尝试访问
[root@ceph conf.d]# echo "test file" > /web5/test.html
[root@ceph conf.d]# systemctl restart nginx
[root@ceph conf.d]# curl 192.168.200.210/test.html
<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>
看到了吗?他就返回的是403,这样做之后,访问test.html的请求就被拒绝掉了,但是如果我们需要拒绝掉所有以test开头的文件呢?也是跟Apache一样使用 * 号吗?不,Nginx是另外的做法
4.2 拒绝访问test开头的所有文件
[root@ceph conf.d]# vim virthost.conf
server {
listen 80;
server_name test.com;
root /web5;
location ^~ /test {
return 403;
}
}
[root@ceph conf.d]# echo test > /web5/test.1
[root@ceph conf.d]# echo test > /web5/test.2
[root@ceph conf.d]# systemctl restart nginx
我们在/web5下创建了test.1和test.2包括之前创建的test.html一共有3个test开头的文件,那我们现在来尝试访问一下
[root@ceph conf.d]# curl 192.168.200.210/test.html -I
HTTP/1.1 403 Forbidden
Server: nginx
Date: Tue, 02 Jul 2024 09:09:49 GMT
Content-Type: text/html
Content-Length: 146
Connection: keep-alive
[root@ceph conf.d]# curl 192.168.200.210/test.1 -I
HTTP/1.1 403 Forbidden
Server: nginx
Date: Tue, 02 Jul 2024 09:09:56 GMT
Content-Type: text/html
Content-Length: 146
Connection: keep-alive
[root@ceph conf.d]# curl 192.168.200.210/test.xxx -I
HTTP/1.1 403 Forbidden
Server: nginx
Date: Tue, 02 Jul 2024 09:10:12 GMT
Content-Type: text/html
Content-Length: 146
Connection: keep-alive
看到了吧,尽管我们访问一个不存在的文件,按道理应该是返回404,但是这个文件是以test开头,那么他会被拒绝访问,不管这个文件存不存在
但是这样配置,只能拒绝掉以test开头的,我如果访问的是Test,那么他就不会被拒绝了
[root@ceph conf.d]# curl 192.168.200.210/Test -I
HTTP/1.1 404 Not Found
Server: nginx
Date: Tue, 02 Jul 2024 09:12:57 GMT
Content-Type: text/html
Content-Length: 146
Connection: keep-alive
对吧,因为我们没有这个资源,所以他返回了404,而不是403,说明没有被拒绝,如果想忽略大小写,可以这样做
4.3 忽略大小写
[root@ceph conf.d]# vim virthost.conf
server {
listen 80;
server_name test.com;
root /web5;
location ~* /test {
return 403;
}
}
只需要将^~
这个地方改为~*
,我们来访问一下看看
[root@ceph conf.d]# curl -I 192.168.200.210/test
HTTP/1.1 403 Forbidden
Server: nginx
Date: Tue, 02 Jul 2024 09:15:17 GMT
Content-Type: text/html
Content-Length: 146
Connection: keep-alive
[root@ceph conf.d]# curl -I 192.168.200.210/Test
HTTP/1.1 403 Forbidden
Server: nginx
Date: Tue, 02 Jul 2024 09:15:21 GMT
Content-Type: text/html
Content-Length: 146
Connection: keep-alive
[root@ceph conf.d]# curl -I 192.168.200.210/TEst
HTTP/1.1 403 Forbidden
Server: nginx
Date: Tue, 02 Jul 2024 09:15:23 GMT
Content-Type: text/html
Content-Length: 146
Connection: keep-alive
现在的配置,不管你的大写的TEST还是小写的test,亦或者是大小写都有的,一律都会被拒绝访问
4.4 反向代理
我们还可以通过location来做反向代理,比如你现在访问我网站下的/
那我就直接给你代理到baidu.com
去,你要搜索啥你自己去搜吧,你以为这个百度是我给你提供的,其实不然,我是把你的请求给到百度了
[root@ceph conf.d]# vim virthost.conf
server {
listen 80;
server_name test.com;
root /web5;
location / {
proxy_pass https://www.baidu.com;
}
}
看到了吗?这是货真价实的百度哦,可以搜索内容的
怎么样,你现在就搭建了一个反向代理,客户端只知道他访问的是192.168.200.210这个IP,他并不知道你把他的请求给了百度,所以客户端会以为你就是百度
5. 配置https
nginx配置https的方式其实跟Apache是差不多的,直接告诉他你的密钥文件放在哪,有2种方式可以配置https,第一种是直接改主配置文件,主配置文件里是有https段落的,只不过默认被注释了。
第二种方式就是自己写一个虚拟主机,我这里直接修改主配置文件
[root@ceph nginx]# vim nginx.conf
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name _;
root /usr/share/nginx/html;
ssl_certificate "/etc/nginx/server.crt";
ssl_certificate_key "/etc/nginx/server.key";
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
将这一段的注释全部给放开,ssl只保留需要的这2行内容,然后将证书地址改为你的证书的实际目录就可以了,然后重启nginx服务
6. Nginx热升级
Nginx热升级是指可以做到不停机升级Nginx的版本,yum安装的Nginx是不支持热升级的,如果想要热升级Nginx,那么你的Nginx必须是源码编译安装的
编译安装流程:
- 下载源码包
- 解压源码包
- 执行预编译 ./configure
- 编译 make
- 编译安装 make install
这是编译安装的流程
在执行到第5步的时候,他就会将编译好的二进制文件放在objs目录下,就是依赖于这个目录下的二进制文件我们才可以做到版本共存
nginx的热升级原理主要依赖于以下几个关键步骤:
- 启动新版本的nginx进程:在进行热升级时,首先启动一个新版本的nginx进程,这个进程会使用新的配置文件和程序文件。
- 旧版本nginx进程继续服务:启动新版本nginx进程后,旧版本的nginx进程仍然继续运行,继续处理客户端的请求。
- 新旧版本的协调切换:新版本nginx进程启动后,会逐渐接管处理新的客户端请求。同时,旧版本nginx进程在处理完当前已有的请求后逐渐退出。
- 共享监听端口:新旧版本的nginx进程可以通过共享监听的网络端口来实现平滑过渡。在大多数情况下,nginx会采用SO_REUSEPORT选项来允许多个进程监听同一个端口。
- 无缝切换:由于新旧版本nginx进程可以并行运行并共享端口,因此在没有中断服务的情况下完成从旧版本到新版本的切换,实现了热升级。
6.1 环境清理
如果你已经使用yum安装了,先卸载nginx
[root@ceph ~]# yum remove -y nginx
6.2 编译安装旧版本Nginx
在这里面找一个相对旧一点的版本,我这里下载一个1.26.1,然后将1.26.1升级到1.27.0
[root@ceph ~]# cd /opt/
[root@ceph opt]# wget https://nginx.org/download/nginx-1.26.1.tar.gz
[root@ceph opt]# tar -zxf nginx-1.26.1.tar.gz
[root@ceph opt]# cd nginx-1.26.1/
[root@ceph nginx-1.26.1]# ls
auto CHANGES.ru configure html man src
CHANGES conf contrib LICENSE README
[root@ceph nginx-1.26.1]# ./configure --prefix=/usr/local/nginx
在这里执行的时候他可能会报错,根据他的报错你安装相对应的软件包就好了
Configuration summary
+ using system PCRE2 library
+ OpenSSL library is not used
+ using system zlib library
nginx path prefix: "/usr/local/nginx"
nginx binary file: "/usr/local/nginx/sbin/nginx"
nginx modules path: "/usr/local/nginx/modules"
nginx configuration prefix: "/usr/local/nginx/conf"
nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
nginx pid file: "/usr/local/nginx/logs/nginx.pid"
nginx error log file: "/usr/local/nginx/logs/error.log"
nginx http access log file: "/usr/local/nginx/logs/access.log"
nginx http client request body temporary files: "client_body_temp"
nginx http proxy temporary files: "proxy_temp"
nginx http fastcgi temporary files: "fastcgi_temp"
nginx http uwsgi temporary files: "uwsgi_temp"
nginx http scgi temporary files: "scgi_temp"
他执行完之后会这样输出就是没有错误,可以继续往下做
[root@ceph nginx-1.26.1]# make -j 4
- -j 指定并行编译的进程数为4
[root@ceph nginx-1.26.1]# make install
6.3 启动旧版nginx
由于我们指定的安装路径是/usr/local/nginx,所以他会在这个目录下生成一个sbin的目录,这个目录里面有一个二进制文件nginx,执行他就可以启动nginx
[root@ceph nginx-1.26.1]# cd /usr/local/nginx/sbin/
[root@ceph sbin]# ./nginx
[root@ceph sbin]# curl -I 192.168.200.210
HTTP/1.1 200 OK
Server: nginx/1.26.1
Date: Tue, 02 Jul 2024 11:27:47 GMT
Content-Type: text/html
Content-Length: 615
Last-Modified: Tue, 02 Jul 2024 11:25:09 GMT
Connection: keep-alive
ETag: "6683e395-267"
Accept-Ranges: bytes
在server这一栏我们可以看见nginx的版本是1.26.1
6.4 下载新版nginx
现在我们将nginx升级到1.27.0
[root@ceph sbin]# cd /opt/
[root@ceph opt]# wget https://nginx.org/download/nginx-1.27.0.tar.gz
[root@ceph opt]# tar -zxf nginx-1.27.0.tar.gz
[root@ceph opt]# cd nginx-1.27.0/
[root@ceph nginx-1.27.0]# ./configure --prefix=/usr/local/nginx
[root@ceph nginx-1.27.0]# make -j 4
这里非常需要注意,一定不要去执行make install
了,因为执行这个命令的话会将原来的nginx全部覆盖掉,我们只需要替换掉nginx的二进制文件就好了
我们来到objs目录
[root@ceph nginx-1.27.0]# ls
auto CHANGES.ru configure html Makefile objs src
CHANGES conf contrib LICENSE man README
[root@ceph nginx-1.27.0]# cd objs/
[root@ceph objs]# ls
autoconf.err nginx ngx_auto_config.h ngx_modules.c src
Makefile nginx.8 ngx_auto_headers.h ngx_modules.o
这里面就有一个nginx的二进制文件,先别着急启动,我们先将老版本的nginx二进制文件进行备份
[root@ceph objs]# cp /usr/local/nginx/sbin/nginx /usr/local/nginx/sbin/nginx.bak
[root@ceph objs]# cd /usr/local/nginx/sbin/
[root@ceph sbin]# cp /opt/nginx-1.27.0/objs/nginx .
cp: overwrite './nginx'? y
[root@ceph sbin]# ./nginx -v
nginx version: nginx/1.27.0
现在我们就已经将1.27.0的二进制文件拷贝到这个地方来了,接下来我们需要将nginx1.27.0也给启动起来。
你这时候可能会有疑问,80端口不是已经被老版本的nginx给占用了吗,我现在在启动不会报错吗?答案肯定是会,所以我们在启动之前还需要进行一个操作,给老版本的nginx'发送一个USR2
的信号
[root@ceph sbin]# ps -ef |grep nginx
root 46538 1 0 19:27 ? 00:00:00 nginx: master process ./nginx
nobody 46539 46538 0 19:27 ? 00:00:00 nginx: worker process
root 49680 15412 0 19:36 pts/0 00:00:00 grep --color=auto nginx
我们查到nginx master的进程id是46538,接下来就是发信号了
[root@ceph sbin]# kill -s USR2 46538
# 然后我们再启动nginx
[root@ceph sbin]# ps -ef |grep nginx
root 46538 1 0 19:27 ? 00:00:00 nginx: master process ./nginx
nobody 46539 46538 0 19:27 ? 00:00:00 nginx: worker process
root 49708 46538 0 19:37 ? 00:00:00 nginx: master process ./nginx
nobody 49709 49708 0 19:37 ? 00:00:00 nginx: worker process
root 49761 15412 0 19:38 pts/0 00:00:00 grep --color=auto nginx
看到了吗?除了老版本的46538之外,还有一个新的nginx master进程,49708
尝试访问
[root@ceph sbin]# curl 192.168.200.210 -I
HTTP/1.1 200 OK
Server: nginx/1.27.0
Date: Tue, 02 Jul 2024 11:39:04 GMT
Content-Type: text/html
Content-Length: 615
Last-Modified: Tue, 02 Jul 2024 11:25:09 GMT
Connection: keep-alive
ETag: "6683e395-267"
Accept-Ranges: bytes
看,他现在处理连接的版本就是1.27.0了,如果老版本的nginx还有连接在处理的话也是不会受到影响的,等我们确认没问题之后我们只需要将老版本给kill掉
[root@ceph sbin]# kill 46538
[root@ceph sbin]# ps -ef |grep nginx
root 49708 1 0 19:37 ? 00:00:00 nginx: master process ./nginx
nobody 49709 49708 0 19:37 ? 00:00:00 nginx: worker process
root 49913 15412 0 19:40 pts/0 00:00:00 grep --color=auto nginx
这个时候老版本就成功退役了,所有的连接都交由新版本的nginx来处理,我们的热升级就搞定了
Nginx配置以及热升级的更多相关文章
- rpm包安装的nginx热升级
文章目录一.本地环境基本介绍二.yum升级命令说明三.升级好nginx后如何不中断业务切换3.1.nginx相关的信号说明3.2.在线热升级nginx可执行文件程序一.本地环境基本介绍本次测试环境,是 ...
- nginx 安装第三方模块(lua)并热升级
需求: nginx上将特定请求拒绝,并返回特定值. 解决办法: 使用lua脚本,实现效果. 操作步骤: 安装Luajit环境 重新编译nginx(目标机器上nginx -V 配置一致,并新增两个模块n ...
- Nginx热升级流程,看这篇就够了
在之前做过 Nginx 热升级的演示,他能保证nginx在不停止服务的情况下更换他的 binary 文件,这个功能非常有用,但我们在执行 Nginx 的 binary 文件升级过程中,还是会遇到很多问 ...
- Nginx安装、平滑升级与虚拟机配置
Nginx 高性能HTTP反向代理服务器,也是 LAMP/POP3/SMTP代理服务器 由内核和模块组成,内核通过找配置文件讲客户端请求映射到一个location(location是Nginx配置中的 ...
- 老版本nginx存在安全漏洞,不停服务热升级
1.场景描述 安全部通知:nginx存在"整数溢出漏洞",经测试2017年4月21日之后的版本无问题,将openresty升级到最新版本,Nginx升级到1.13.2之后的版本. ...
- 原创|1分钟搞定 Nginx 版本的平滑升级与回滚
Nginx无论是对于运维.开发.还是测试来说,都是日常工作需要掌握的一个知识点,之前也写过不少关于Nginx相关的文章: Nginx服务介绍与安装 Nginx服务配置文件介绍 Nginx配置虚拟主机 ...
- Golang服务器热重启、热升级、热更新(safe and graceful hot-restart/reload http server)详解
服务端代码经常需要升级,对于线上系统的升级常用的做法是,通过前端的负载均衡(如nginx)来保证升级时至少有一个服务可用,依次(灰度)升级. 而另一种更方便的方法是在应用上做热重启,直接更新源码.配置 ...
- 你需要知道的Nginx配置二三事
做服务端开发的,工作中难免会遇到处理Nginx配置相关问题.在配置Nginx时,我一直本着“照葫芦画瓢”的原则,复制已有的配置代码,自己修修改改然后完成配置需求,当有人问起Nginx相关问题时,其实仍 ...
- Nginx配置详解
序言 Nginx是lgor Sysoev为俄罗斯访问量第二的rambler.ru站点设计开发的.从2004年发布至今,凭借开源的力量,已经接近成熟与完善. Nginx功能丰富,可作为HTTP服务器,也 ...
- 免费SSL-HTTS 申请与配置 NGINX配置
Let's Encrypt是很火的一个免费SSL证书发行项目,自动化发行证书,证书有90天的有效期.适合个人使用或者临时使用,不用再忍受自签发证书不受浏览器信赖的提示.Let's Encrypt已经发 ...
随机推荐
- M3U8下载器加嗅探浏览器
M3U8下载器太多了,随便一抓一大把,没什么新奇的. 下载地址: https://www.zhaimaojun.cn/P/%e8%a7%86%e9%a2%91%e7%bd%91%e7%ab%99%e5 ...
- uniapp底层跨端原理
uniapp底层跨端原理 - 代码编写:开发者使用Vue.js框架编写uniapp的代码,包括页面结构.样式和逻辑等. - 编译过程:在编译过程中,uniapp会将Vue.js的代码转换为各个平台所需 ...
- 让创意在幻觉中肆虐: 认识Illusion Diffusion AI
人工智能新境界 在不断发展的人工智能领域,一款非凡的新工具应运而生,它能将普通照片转化为绚丽的艺术品.敬请关注Illusion Diffusion,这是一个将现实与想象力完美融合的AI驱动平台,可创造 ...
- JDK源码阅读-------自学笔记(十五)(java.lang.Math数学类)
Math类简介 用于常见的数学方法 如果需要更加强大的数学运算能力,计算高等数学中的相关内容,可以使用apache commons下面的Math类库 常用方法及实战 abs 绝对值 实例: 1 //绝 ...
- Pageoffice6 实现后台生成单个PDF文档
在实际项目中经常遇到这样的场景,客户希望后台动态生成PDF文档,目前网上有一些针对此需求的方案,如果您想要了解这些方案的对比,请查看后台生成单个Word文档中的"方案对比". Pa ...
- MySQL 字段截取拼接
@ 目录 前言 需求: 拼接函数: 截取函数: 总结 前言 请各大网友尊重本人原创知识分享,谨记本人博客:南国以南i. 提示:以下是本篇文章正文内容,下面案例可供参考 需求: 将数据库中的某一个字段的 ...
- HttpWebRequest , HttpWebResponse 调用示例
1, public string sendPost1(string url, string content) { string result = ""; HttpWebReques ...
- # [NOIP2011 提高组] 铺地毯
传送锚点:https://www.luogu.com.cn/problem/P1003 题目描述 为了准备一个独特的颁奖典礼,组织者在会场的一片矩形区域(可看做是平面直角坐标系的第一象限)铺上一些矩形 ...
- HTML——基本标签
1.标题标签 <h1>标题1</h1> <h2>标题2</h2> <h3>标题3</h3> <h4>标题4</ ...
- Rainbond 5.5 发布,支持Istio和扩展第三方Service Mesh框架
Rainbond 5.5 版本主要优化扩展性.服务治理模式可以扩展第三方 ServiceMesh 架构,兼容kubernetes 管理命令和第三方管理平台. 主要功能点解读: 1. 支持 Istio, ...