ARTICLE DETAIL

资讯详情

深耕网站建设与运营推广的一线实战洞察。

Nginx 部署 PHP 站点 + 反向代理完整实战|从配置到排错,可直接复制上线

Nginx 部署 PHP 站点 + 反向代理完整实战|从配置到排错,可直接复制上线 Nginx 服务器Nginx 是一款高性能的HTTP和反向代理服务器。在高连接并发的情况下能够支持高达5万个并发连接数的响应而内存、CPU等系统资源消耗却非常低运行非常稳定。Nginx 部署# 安装 nginxyum-yinstallnginx# 启动 nginxsystemctlenablenginx--now# 准备主页mv/usr/share/nginx/html/index.html{,.ori}decho Hello World From Nginx/usr/share/nginx/html/index.html# 防火墙firewall-cmd --add-servicehttp--permanentfirewall-cmd--reloadcurlhttp://www.shaka.cloud# windows客户端修改 C:\Windows\System32\drivers\etc\hosts# Linux或Unix修改 /etc/hosts# 添加如下记录10.1.8.10 www.shaka.cloud动态站点静态站点站点的内容是固定不变的。动态站点内容是通过程序生成的每次都可能提供新的东西。使用 PHP客户端访问php网页流程请求php页面发送给web服务器。web服务器发现访问的内容是php则将php的页面交给php-fpm服务处理。php-fpm服务将php页面交给php程序解析执行执行结果返回给php-fpm。php-fpm服务将结果返回给web服务器。web服务器将结果返回给客户端。# 安装PHP和php-fpm建议把其他的扩展包一起安装[rootserver ~ 09:45:01]# yum install -y php php-fpm# php-fpm: 负责接收web程序发来的php代码# php负责解析和执行php代码并将结果返回给php-fpm# 当客户端访问 php 站点时web站点接收用户请求# 并转发 php 代码给php-fpm服务# php-fpm 服务调用php解析php网页然后将结果返回给web程序# web 程序将结果返回给客户端# 启用并启动php-fpm服务[rootserver ~ 09:46:42]# systemctl enable php-fpm.service --now# 建议把其他的扩展包一起安装[rootserver ~ 09:46:42]# yum install -y php-gd php-common php-pear php-mbstring php-mcrypt# 查看 php 版本[rootserver ~ 09:55:41]# php -vPHP5.4.16(cli)(built: Apr1202004:07:17)Copyright(c)1997-2013 The PHP Group Zend Engine v2.4.0, Copyright(c)1998-2013 Zend Technologies# 测试 php 是否正常[rootserver ~ 09:55:46]# echo ?php echo PHP Test Page.\\n\; ? php_test.php[rootserver ~ 09:56:24]# php php_test.phpPHP Test Page# 准备测试页使用phpinfo查看详细信息[rootserver ~ 09:56:33]# echo ?php phpinfo(); ? /usr/share/nginx/html/phpinfo.php配置虚拟机主机支持php#按照默认配置修改[rootserver ~ 09:57:27]# cp /etc/nginx/nginx.conf /etc/nginx/conf.d/vhost-www.shaka.cloud-php.conf# 修改配置文件#直接弄一个最简单的配置不要证书和重定向[rootserver certs10:09:07]# vim /etc/nginx/conf.d/vhost-www.shaka.cloud-php.confserver{listen80;listen[::]:80;server_name www.shaka.cloud;root /usr/share/nginx/html;location ~\.php${try_files$uri404;# fastcgi_pass指定FastCGI服务地址将PHP请求转发到本地9000端口的PHP-FPM进程fastcgi_pass127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME$document_root$fastcgi_script_name;include fastcgi_params;}}还可以将php的配置与虚拟主机配置分离配置[rootserver certs10:35:50]# cat /etc/nginx/conf.d/vhost-www.shaka.cloud-php.confserver{listen80;listen[::]:80;server_name www.shaka.cloud;root /usr/share/nginx/html;# Load configuration files for the default server block.include /etc/nginx/default.d/*.conf;}[rootserver certs10:36:07]# cat /etc/nginx/default.d/vhost-www.shaka.cloud-php.conflocation ~\.php${try_files$uri404;fastcgi_pass127.0.0.1:9000;fastcgi_index index.php;fastcgi_param SCRIPT_FILENAME$document_root$fastcgi_script_name;include fastcgi_params;}配置完成后务必要重启nginx服务[rootserver certs10:35:45]# systemctl restart nginx反向代理反向代理介绍反向代理reverse proxy指的是**代理外网用户的请求到内部的指定的服务器并将数据返回给用户。**客户端不直接与后端服务器进行通信而是与反向代理服务器进行通信,隐藏了后端服务器的 IP 地址。反向代理的主要作用是提供负载均衡和高可用性负载均衡Nginx可以将传入的请求分发给多个后端服务器以平衡服务器的负载提高系统性能和可靠性。缓存功能Nginx可以缓存静态文件或动态页面减轻服务器的负载提高响应速度。动静分离将动态生成的内容如 PHP、Python、Node.js 等和静态资源如 HTML、CSS、JavaScript、图片、视频等分别存放在不同的服务器或路径上。多站点代理Nginx可以代理多个域名或虚拟主机将不同的请求转发到不同的后端服务器上实现多个站点的共享端口。Location 配置Location 配置语法Nginx 使用location匹配规则 proxy_pass反向代理指令实现反向代理功能匹配本质是 “URL 路径匹配 → 命中对应规则 → 转发至指定后端地址”。location定义匹配路径proxy_pass指定后端服务地址http { # 后端服务可配置 upstream 集群推荐支持负载均衡 upstream backend_nginx { nginx 192.168.1.100:8080; # 后端服务1 nginx 192.168.1.101:8080; # 后端服务2多节点自动轮询负载均衡 } server { listen 80; # Nginx 监听端口 server_name localhost; # 访问域名/IP # 1. 匹配所有请求兜底规则 location / { proxy_pass http://backend_nginx; # 转发至 upstream 集群 # 必加的反向代理核心参数传递客户端真实信息、适配后端服务 proxy_set_header Host $host; # 传递客户端访问的域名 proxy_set_header X-Real-IP $remote_addr; # 传递客户端真实IP proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #传递IP链路 proxy_set_header X-Forwarded-Proto $scheme; # 传递请求协议http/https } # 2. 匹配特定路径如 /api 开头的请求单独转发 location /api/ { proxy_pass http://192.168.1.102:9090/; # 后端地址末尾带 /会剔除匹配的 /api/ proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } } }Location 匹配规则后端匹配逻辑URL 路径 → 按 location 优先级命中规则 → 由规则内的 proxy_pass 转发至对应后端优先级精确匹配 前缀匹配^~ 正则匹配/* 普通前缀 兜底/URL 重构关键proxy_pass末尾是否带 /决定是否剔除 location 匹配的路径前缀。1. 精确匹配语法location /path { ... }逻辑仅当请求 URL 与/path完全一致时命中优先级最高。示例# 仅匹配 http://localhost/login不匹配 /login?a1、/login/ location /login { proxy_pass http://backend_login:8080; }2. 前缀配^~语法location ^~ /path { ... }逻辑URL 以/path开头即命中优先级仅次于精确匹配会跳过正则匹配。用途优先匹配静态资源如 /static、/img或特定业务路径避免被正则规则拦截。示例# 匹配所有 /static 开头的请求如 /static/css/main.css、/static/img/1.jpg location ^~ /static/ { proxy_pass http://backend_static:80; }3. 正则匹配~ / ~*语法区分大小写location ~ /regex { ... }如 /API 不匹配 /api 规则不区分大小写location ~* /regex { ... }如 /API、/api 均匹配逻辑URL 符合正则表达式即命中优先级低于前缀匹配^~多个正则规则按定义顺序匹配先命中先生效。示例# 匹配所有 .jpg、.png、.gif 结尾的图片请求不区分大小写 location ~* \.(jpg|png|gif)$ { proxy_pass http://backend_img:80; }4. 普通前缀匹配无符号语法location /path { ... }逻辑URL 以/path开头即命中优先级低于正则匹配多个普通前缀规则按 “路径最长” 优先命中。示例# 规则1匹配 /api/xxx路径长度3 location /api/ { proxy_pass http://backend_api:9090; } # 规则2匹配 /api/user/xxx路径长度7比规则1长优先命中 location /api/user/ { proxy_pass http://backend_user:9090; }5. 通用匹配/语法location / { ... }逻辑所有未被上述规则命中的请求都会匹配此规则兜底优先级最低。用途通常作为全局反向代理转发所有默认请求到主后端服务。proxy_pass 后端地址细节proxy_pass末尾是否带/会直接改变转发到后端的 URL 路径这是后端匹配后 “URL 重构” 的核心分 2 种场景场景 1proxy_pass 末尾带 /逻辑转发时会剔除 location 匹配的路径前缀将剩余路径拼接在后端地址后。示例# location 匹配 /api/proxy_pass 末尾带 / location /api/ { proxy_pass http://192.168.1.102:9090/; } # 实际转发逻辑 # 客户端请求 http://localhost/api/user/list → 后端接收 http://192.168.1.102:9090/user/list场景 2proxy_pass 末尾不带 /逻辑转发时会保留 location 匹配的路径前缀直接拼接在后端地址后。示例# location 匹配 /api/proxy_pass 末尾不带 / location /api/ { proxy_pass http://192.168.1.102:9090; } # 实际转发逻辑 # 客户端请求 http://localhost/api/user/list → 后端接收 http://192.168.1.102:9090/api/user/list综合示例配置文件http { upstream backend_main { nginx 192.168.1.200:8080; } upstream backend_api { nginx 192.168.1.201:9090; } upstream backend_static { nginx 192.168.1.202:80; } upstream backend_login { nginx 192.168.1.203:8080; } server { listen 80; server_name localhost; # 1. 精确匹配仅 /login → 后端 login 服务 location /login { proxy_pass http://backend_login; proxy_set_header Host $host; } # 2. 前缀匹配/static/ 开头 → 后端静态服务跳过正则 location ^~ /static/ { proxy_pass http://backend_static; proxy_set_header Host $host; } # 3. 正则匹配图片后缀 → 后端静态服务 location ~* \.(jpg|png|gif)$ { proxy_pass http://backend_static; proxy_set_header Host $host; } # 4. 普通前缀/api/ 开头 → 后端 api 服务 location /api/ { proxy_pass http://backend_api/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } # 5. 兜底匹配所有未命中的请求 → 主后端服务 location / { proxy_pass http://backend_main; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; } } }匹配流程客户端请求 URL命中的 location 规则转发至后端的 URL对应后端服务http://localhost/login /loginhttp://192.168.1.203:8080backend_loginhttp://localhost/static/css/main.css^~ /static/http://192.168.1.202:80/css/main.cssbackend_statichttp://localhost/img/1.jpg~* .(jpgpnggif)$http://192.168.1.202:80/img/1.jpgbackend_statichttp://localhost/api/user/info/api/http://192.168.1.201:9090/user/infobackend_apihttp://localhost/index/http://192.168.1.200:8080/indexbackend_main反向代理实践环境环境架构服务器主机名IP地址服务器角色客户端client.shaka.cloud10.1.8.11测试服务器Nginx 服务器proxy.shaka.cloud10.1.8.20代理服务器Nginx 服务器nginx1.shaka.cloud10.1.8.21Web 服务器Nginx 服务器nginx2.shaka.cloud10.1.8.22Web 服务器Nginx 服务器nginx3.shaka.cloud10.1.8.23Web 服务器/etc/hosts# 所有节点[rootproxy ~14:23:35]# vim /etc/hosts127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6############ proxy ##################10.1.8.11 client.shaka.cloud client10.1.8.20 www.shaka.cloud www10.1.8.20 proxy.shaka.cloud proxy10.1.8.21 nginx1.shaka.cloud nginx110.1.8.22 nginx2.shaka.cloud nginx210.1.8.23 nginx3.shaka.cloud nginx3后端 nginx 服务器配置# 除了客户端所有节点安装nginx并启动nginx服务。# 用client批量处理[rootclient ~14:49:33]# for host in 10.1.8.{20,21,22,23}; do echo ;ssh root$host yum install -y nginx; done#查询是否安装成功[rootclient ~14:49:48]# for host in 10.1.8.{20,21,22,23}; do echo ;ssh root$host rpm -q nginx; donenginx-1.20.1-10.el7.x86_64 nginx-1.20.1-10.el7.x86_64 nginx-1.20.1-10.el7.x86_64 nginx-1.20.1-10.el7.x86_64# 启动并启用服务[rootclient ~14:52:22]# for host in 10.1.8.{20,21,22,23}; do ssh root$host systemctl enable nginx --now; done# 防火墙设置所有节点全都关[rootclient ~14:52:22]# firewall-cmd --add-servicehttp --permanent[rootclient ~14:52:22]# firewall-cmd --add-servicehttp# 准备主页-其他节点[rootclient ~14:57:27]# for host in nginx{1..3}; do ssh root$host echo Welcome to $host /usr/share/nginx/html/index.html; done# 客户端测试[rootclient ~14:57:48]# curl http://nginx1/Welcome to nginx1[rootclient ~14:57:53]# curl http://nginx2/Welcome to nginx2[rootclient ~14:57:55]# curl http://nginx3/Welcome to nginx3前端 proxy 服务器配置# 准备主页-代理节点[rootproxy ~14:35:23]# yum -y install nginx[rootproxy ~14:36:55]# echo Welcome to www.shaka.cloud /usr/share/nginx/html/index.html[rootproxy ~15:06:48]# mkdir /var/nginx[rootproxy ~15:06:52]# echo Hello, Nginx /var/nginx/index.html[rootproxy ~15:06:56]# echo Hello, shaka /var/nginx/test.txt[rootproxy ~15:07:04]# cp /usr/share/nginx/html/nginx-logo.png /var/nginx/[rootproxy ~15:07:10]# ls /var/nginx/index.html nginx-logo.png test.txt[rootproxy ~15:07:13]# vim /etc/nginx/conf.d/proxy.confserver { listen 80; server_name www.shaka.cloud; # 匹配根位置 location / { root /var/nginx; index index.html; } }# 重新加载nginx配置[rootproxy ~15:07:53]# nginx -s reload测试[rootproxy ~15:07:57]# curl http://www.shaka.cloudHello, Nginx[rootproxy ~15:08:07]# curl http://www.shaka.cloud/test.txtHello, shaka反向代理基础实践-代理本地环境准备[rootproxy ~15:08:51]# mkdir /var/nginx/nginx{1,2}[rootproxy ~15:16:05]# echo Hello, Im here /var/nginx/nginx1 /var/nginx/nginx1/index.html[rootproxy ~15:17:15]# echo Hello, Im here /var/nginx/nginx2 /var/nginx/nginx2/index.html[rootproxy ~15:17:26]# mkdir /var/nginx{1,2}[rootproxy ~15:17:33]# echo Hello, Nginx1 /var/nginx1/index.html[rootproxy ~15:17:37]# echo Hello, Nginx2 /var/nginx2/index.html[rootproxy ~15:18:31]# tree /var/nginx*/var/nginx ├── index.html ├── nginx1 │ └── index.html ├── nginx2 │ └── index.html ├── nginx-logo.png └── test.txt /var/nginx1 └── index.html /var/nginx2 └── index.html2directories,7files[rootproxy ~15:19:08]# \forpath1inwww{1..2}doforpath2innginx{1..2}domkdir-p/var/$path1/$path2echoHello, Im here /var/$path1/$path2/var/$path1/$path2/index.htmldonedone[rootproxy ~15:21:26]# tree /var/www*/var/www1 ├── nginx1 │ └── index.html └── nginx2 └── index.html /var/www2 ├── nginx1 │ └── index.html └── nginx2 └── index.html4directories,4files基本测试[rootproxy ~15:21:31]# curl http://www.shaka.cloud/Hello, Nginx# 显示结果是目录/var/nginx/nginx1中内容[rootproxy ~15:21:56]# curl http://www.shaka.cloud/nginx1/Hello, Im here /var/nginx/nginx1 # 显示结果是目录/var/nginx/nginx2中内容 [rootproxy ~ 15:22:05]# curl http://www.shaka.cloud/nginx2/ Hello, Im here /var/nginx/nginx2实践1无符号匹配[rootproxy ~15:37:23]# vim /etc/nginx/conf.d/proxy.confserver { listen 80; server_name www.shaka.cloud; # 匹配根位置 location / { root /var/nginx; index index.html; } # 匹配/nginx1时/var目录下找nginx1完整路径是/var/nginx1 location /nginx1 { root /var; # 等效于下面的 alias 语句必须使用绝对路径 # alias /var/nginx1; index index.html; } }# 重新加载nginx配置[rootproxy ~15:37:58]# nginx -s reload访问测试# nginx1 后面必须添加 / 符号[rootclient ~14:59:05]# curl http://www.shaka.cloud/nginx1/Hello, Nginx1# 显示结果是目录/var/nginx1中内容# nginx2 后面必须添加 / 符号[rootclient ~15:39:50]# curl http://www.shaka.cloud/nginx2/Hello, Im here /var/nginx/nginx2# 显示结果是目录/var/nginx/nginx2中内容实验结果无符号匹配优先级高于默认的/。实践2正则表达式匹配[rootproxy ~15:38:24]# vim /etc/nginx/conf.d/proxy.confserver { listen 80; server_name www.shaka.cloud; # 匹配根位置 location / { root /var/nginx; index index.html; } # 匹配/nginx1时/var目录下找nginx1完整路径是/var/nginx1 location /nginx1 { root /var; # 等效于下面的 alias 语句必须使用绝对路径 # alias /var/nginx1; index index.html; } # 正则表达式匹配 /nginx.* location ~ /nginx.* { root /var/www1; index index.html; } }# 重新加载nginx配置[rootproxy ~15:40:42]# nginx -s reload访问测试# nginx1 后面必须添加 / 符号[rootclient ~15:40:01]# curl http://www.shaka.cloud/nginx1/Hello, Im here /var/www1/nginx1 # 显示结果是目录/var/www1/nginx1中内容 # nginx2 后面必须添加 / 符号 [rootclient ~ 15:41:02]# curl http://www.shaka.cloud/nginx2/ Hello, Im here /var/www1/nginx2# 显示结果是目录/var/www1/nginx2中内容实验结果正则表达式匹配优先级高于无符号。实践3精确匹配[rootproxy ~15:40:45]# vim /etc/nginx/conf.d/proxy.confserver { listen 80; server_name www.shaka.cloud; # 匹配根位置 location / { root /var/nginx; index index.html; } # 匹配/nginx1时/var目录下找nginx1完整路径是/var/nginx1 location /nginx1 { root /var; # 等效于下面的 alias 语句必须使用绝对路径 # alias /var/nginx1; index index.html; } # 正则表达式匹配 /nginx.* location ~ /nginx.* { root /var/www1; index index.html; } # 精确匹配 location /nginx2/index.html { root /var/www2; index index.html; } }# 重新加载nginx配置[rootproxy ~15:41:26]# nginx -s reload访问测试# nginx1 后面必须添加 / 符号[rootclient ~15:41:09]# curl http://www.shaka.cloud/nginx1/Hello, Im here /var/www1/nginx1 # 显示结果是目录/var/www1/nginx1中内容 # nginx2 后面必须添加 / 符号 [rootclient ~ 15:41:36]# curl http://www.shaka.cloud/nginx2/ Hello, Im here /var/www2/nginx2# 显示结果是目录/var/www2/nginx2中内容实验结果精确匹配优先级高于正则表达式。反向代理基础实践-代理远端实践1无符号匹配[rootproxy ~15:56:40]# vim /etc/nginx/conf.d/proxy.confserver { listen 80; server_name www.shaka.cloud; # 匹配根位置 location / { root /var/nginx; index index.html; } # 匹配 /nginx1/ 开头代理到nginx1.shaka.cloud/nginx1/不组合到后端服务器 # 访问 /nginx1/ 开头相当于直接访问http://nginx1.shaka.cloud/ location /nginx1/ { # 后端服务 proxy_pass http://nginx1.shaka.cloud/; # 注意代理后端后面有 /。 index index.html; } }# 重新加载nginx配置[rootproxy ~15:57:25]# nginx -s reload访问测试# nginx1 后面必须添加 / 符号[rootclient ~15:46:48]# curl http://www.shaka.cloud/nginx1/Welcome to nginx1.shaka.cloud# 显示结果是服务器 nginx1.shaka.cloud 内容# nginx2 后面必须添加 / 符号[rootclient ~16:09:39]# curl http://www.shaka.cloud/nginx2/Hello, Im here /var/nginx/nginx2# 显示结果是目录/var/nginx/nginx2中内容实验结果无符号匹配优先级高于默认的/。实践2正则表达式匹配[rootproxy ~16:09:30]# vim /etc/nginx/conf.d/proxy.confserver { listen 80; server_name www.shaka.cloud; # 匹配根位置 location / { root /var/nginx; index index.html; } # 匹配 /nginx1/ 开头代理到nginx1.shaka.cloud/nginx1/不组合到后端服务器 # 访问 /nginx1/ 开头相当于直接访问http://nginx1.shaka.cloud/ location /nginx1/ { # 后端服务 proxy_pass http://nginx1.shaka.cloud/; # 注意代理后端后面有 /。 index index.html; } # 正则表达式匹配 /nginx.* location ~ /nginx[123].* { # 手动重写路径去掉 /nginx 前缀转发到目标服务器 # ^/nginx[123](.*)$ 匹配 /nginx[123] 开头的完整路径$1表示 /nginx[123] 后的所有内容 # break 表示重写后不再匹配其他 rewrite 规则 rewrite ^/nginx[123](.*)$ $1 break; # proxy_pass 不带 URI无末尾的 /配合 rewrite 实现路径替换 proxy_pass http://nginx2.shaka.cloud; index index.html; } }# 重新加载nginx配置[rootproxy ~16:10:35]# nginx -s reload访问测试# nginx1 后面必须添加 / 符号[rootclient ~16:11:54]# curl http://www.shaka.cloud/nginx1/Welcome to nginx2.shaka.cloud# 显示结果是服务器 nginx2.shaka.cloud 内容# nginx2 后面必须添加 / 符号[rootclient ~16:12:02]# curl http://www.shaka.cloud/nginx2/Welcome to nginx2.shaka.cloud# 显示结果是服务器 nginx2.shaka.cloud 内容# nginx3 后面必须添加 / 符号[rootclient ~16:12:07]# curl http://www.shaka.cloud/nginx3/Welcome to nginx2.shaka.cloud# 显示结果是服务器 nginx2.shaka.cloud 内容实验结果正则表达式匹配优先级高于无符号。实践3精确匹配[rootproxy ~16:11:51]# vim /etc/nginx/conf.d/proxy.confserver { listen 80; server_name www.shaka.cloud; # 匹配根位置 location / { root /var/nginx; index index.html; } # 匹配 /nginx1/ 开头代理到nginx1.shaka.cloud/nginx1/不组合到后端服务器 # 访问 /nginx1/ 开头相当于直接访问http://nginx1.shaka.cloud/ location /nginx1/ { # 后端服务 proxy_pass http://nginx1.shaka.cloud/; # 注意代理后端后面有 /。 index index.html; } # 正则表达式匹配 /nginx.* location ~ /nginx[123].* { # 手动重写路径去掉 /nginx 前缀转发到目标服务器 # ^/nginx[123](.*)$ 匹配 /nginx[123] 开头的完整路径$1表示 /nginx[12] 后的所有内容 # break 表示重写后不再匹配其他 rewrite 规则 rewrite ^/nginx[123](.*)$ $1 break; # proxy_pass 不带 URI无末尾的 /配合 rewrite 实现路径替换 proxy_pass http://nginx2.shaka.cloud; index index.html; } # 精确匹配 location /nginx3/ { proxy_pass http://nginx3.shaka.cloud/; index index.html; } }# 重新加载nginx配置[rootproxy ~16:13:18]# nginx -s reload访问测试# nginx1 后面必须添加 / 符号[rootclient ~16:12:46]# curl http://www.shaka.cloud/nginx1/Welcome to nginx2.shaka.cloud# 显示结果是服务器 nginx2.shaka.cloud 内容# nginx2 后面必须添加 / 符号[rootclient ~16:13:40]# curl http://www.shaka.cloud/nginx2/Welcome to nginx2.shaka.cloud# 显示结果是服务器 nginx2.shaka.cloud 内容# nginx3 后面必须添加 / 符号[rootclient ~16:13:43]# curl http://www.shaka.cloud/nginx3/Welcome to nginx3.shaka.cloud# 显示结果是服务器 nginx3.shaka.cloud 内容实验结果精确匹配优先级高于正则表达式。
返回列表