当前位置:首页>Linux>Linux、Nginx学习第四周 Nginx 的 server / location / root / alias 一篇讲透

Linux、Nginx学习第四周 Nginx 的 server / location / root / alias 一篇讲透

  • 2026-08-18 23:11:53
Linux、Nginx学习第四周 Nginx 的 server / location / root / alias 一篇讲透

上一篇把 Nginx 整体结构和第一个站点跑起来了。这一篇专门钻新人栽得最频繁、面试问得最高频的几个概念:server 怎么匹配域名、location 优先级、root 和 alias 的区别

我自己面试候选人时,问 location 五种匹配优先级能答全的不到三成;线上 nginx 配置改错的事故,一半以上是 root / alias 用混了。这一篇按真实排查流程讲透。


一、server 是怎么被匹配上的

一台 Nginx 上常常跑十几个 server(虚拟主机),来一个请求选哪个 server 处理?走这个顺序:

1. 先按 listen 端口过滤(只看监听同一端口的 server)2. 再按 server_name 匹配(精确 → 通配符 → 正则 → default_server)

第一步:listen 端口

nginx
server {listen80;server_name a.example.com;}server {listen8080;server_name a.example.com;}

同一个 a.example.com,访问 80 端口走第一个,访问 8080 走第二个。端口是硬过滤

第二步:server_name 四级优先级

优先级
写法
例子
命中
1(最高)
精确匹配
server_name a.example.com;a.example.com
2
前缀通配符
server_name *.example.com;x.example.com
 / y.example.com
3
后缀通配符
server_name example.*;example.com
 / example.cn
4
正则匹配
server_name ~^api\d+\.example\.com$;api1.example.com
5(兜底)
default_server
listen 80 default_server;
都不匹配时走它

注意一个反直觉的点正则优先级比通配符低*.example.com 会先吃掉,正则只在通配符没命中时才匹配。

server_name 实用写法

nginx
# 精确单个server_name a.example.com;# 多个精确(一个 server 服务多域名)server_name a.example.com b.example.com;# 通配符server_name*.example.com;# 主域 + 所有子域server_name example.com *.example.com;# 兜底:catch-allserver_name _;# 正则(必须 ~ 开头)server_name ~^api(?<num>\d+)\.example\.com$;

listen 写法的几个变种

nginx
listen80;                          # IPv4 任意地址listen [::]:80;                     # IPv6 任意地址listen80 default_server;           # 标记为默认 server(**同一端口只能有一个 default**)listen443 ssl http2;               # HTTPS + HTTP/2(注意 1.25.1 起推荐写 `http2 on;`)listen unix:/run/nginx-internal.sock;   # Unix socket(内部转发用)listen80 reuseport;                # 启用 SO_REUSEPORT,多 worker 各自 accept(高并发场景)

default_server 的重要性

如果一个请求带的 Host 头谁都不匹配(比如别人拿你的 IP 直接打),会走 default_server没显式指定时,会走「同端口下第一个 server」,常常导致莫名其妙的请求被某个不相关的 server 接走。生产配置永远建议

nginx
# 第一个 server 就放个明确的 default,拒绝未识别 Hostserver {listen80 default_server;server_name _;return444;       # nginx 内部状态码,直接关闭连接不返回}

二、location 五种匹配方式与优先级(面试高频)

server 选好之后,按 URL 路径匹配 location。location 有五种写法优先级不是从上到下,而是按修饰符决定。

优先级
修饰符
含义
例子
1(最高)
=精确匹配
,命中就停
location = /favicon.ico
2
^~
前缀匹配,命中就停(不再走正则)
location ^~ /static/
3
~区分大小写正则
,按配置顺序
location ~ \.php$
3
~*不区分大小写正则
,按配置顺序
location ~* \.(jpg|png)$
4(最低)
(无)
普通前缀,记录最长匹配后继续
location /api/

匹配流程总结一句话

Nginx 先把所有前缀 location(无修饰符 + ^~ + =)扫一遍,挑出最长前缀;如果最长前缀是 = 或 ^~,直接定;否则继续按配置顺序匹配正则 location,命中正则就走正则,没命中走那个最长前缀。

用一个完整例子演示

nginx
server {listen80;server_name demo.local;location = / {return200"A: 精确根路径\n";    }location = /favicon.ico {return200"B: 精确 favicon\n";    }location ^~ /static/ {return200"C: ^~ /static/\n";    }location~ \.php$ {return200"D: 正则 .php\n";    }location~* \.(jpg|png|gif)$ {return200"E: 正则不区分大小写图片\n";    }location /api/ {return200"F: 普通前缀 /api/\n";    }location / {return200"G: 普通前缀 / (兜底)\n";    }}

访问不同 URL 命中谁:

请求 URL
命中
原因
/
A
=
 精确匹配
/favicon.ico
B
=
 精确匹配
/static/css/app.css
C
^~
 命中后停(不再走正则)
/static/image.PNG
C
同上,虽然像图片但 ^~ 阻断了正则
/index.php
D
没前缀强约束,走正则 \.php$
/photo.jpg
E
同上,走 ~* 正则
/photo.JPG
E
大小写不敏感
/api/users
F
最长前缀 /api/,没匹配到正则就走它
/about
G
啥都不匹配,走兜底 /

面试题最爱问的两点

  • ^~ 不是「正则」,是「前缀但抑制正则」
    。新人爱说成「^~ 是开头匹配」,是错的——它是前缀匹配里的一个修饰,命中后直接跳过正则阶段
  • 正则之间按出现顺序匹配
    普通前缀按最长匹配。所以正则的相对顺序很重要,普通前缀的写法顺序不重要

三、root vs alias 的关键差异(踩坑王)

这两个指令都用来「告诉 nginx 文件在磁盘的哪儿」,但逻辑完全不同

  • root
    :拼接 location 的路径
  • alias
    :替换 location 的路径

用同一个请求演示

请求 URL:/static/x.png

nginx
# 写法 1:用 rootlocation /static/ {root /var/www;}# Nginx 拼接:root + 完整 URI# 实际磁盘路径:/var/www/static/x.png# 写法 2:用 aliaslocation /static/ {alias /var/www/assets/;}# Nginx 替换:alias 替换掉 location 部分# 实际磁盘路径:/var/www/assets/x.png# 写法 3:alias 路径与 location 不同名(最常见用法)location /imgs/ {alias /data/pictures/;}# 请求 /imgs/cat.jpg → 磁盘 /data/pictures/cat.jpg

一张对照表

维度
root
alias
路径关系
拼接(保留 location 部分)
替换(去掉 location 部分)
末尾斜杠
不严格要求
alias 是目录时必须以 / 结尾
可用位置
http / server / location
只能用在 location 内
与正则配合
直接用
正则 location 用 alias 要写 $1 类捕获
推荐写在哪
server 级写一份默认
各 location 各自指定

root 的最佳实践

默认把 root 写在 server 级别一份,各 location 不重复写:

nginx
server {listen80;server_name demo.local;root /var/www/my-site;        # ← 默认根目录location / {try_files$uri$uri/ /index.html;    }location /docs/ {# 没写 root,自动用 server 级别的 /var/www/my-site# 请求 /docs/a.html → /var/www/my-site/docs/a.html    }location /assets/ {# 想给 /assets 单独换路径,这里覆盖alias /opt/cdn-cache/;# 请求 /assets/main.css → /opt/cdn-cache/main.css    }}

alias 三个最高频踩坑

nginx
# ❌ 坑 1:alias 末尾没斜杠location /static/ {alias /var/www/assets;    # 缺 /}# 请求 /static/x.png 实际去找 /var/www/assetsx.png(路径被拼坏)# ✅ 正确:location 和 alias 都要么都有 /,要么都没 /location /static/ {alias /var/www/assets/;}# ❌ 坑 2:在 server 上下文用了 aliasserver {alias /var/www/x;         # ❌ alias 不能用在 server 级}# ❌ 坑 3:正则 location 配 alias 用错变量location~ ^/imgs/(.+)\.jpg$ {alias /data/$1.jpg;        # 这种写法在新版 nginx 已不推荐,建议 try_files}

四、try_files 的妙用:SPA 兜底必备

try_files 让 nginx 按顺序尝试多个文件,第一个存在的就用,全都不存在走最后一个(可以是一个 URI 或状态码)。

静态文件兜底 404

nginx
location / {try_files$uri$uri/ =404;# 1. 试 $uri 本身是不是文件# 2. 试 $uri/ 是不是目录(自动找 index)# 3. 都没有,返回 404}

SPA 单页应用(Vue / React)

nginx
location / {try_files$uri$uri/ /index.html;# 文件在就给文件,否则统统返回 index.html# 这样前端路由刷新 /users/123 也不会 404}

没有这一行,前端路由刷新就死——Nginx 看到 /users/123 不存在直接 404,因为这个 URL 是前端 router 在浏览器里识别的,nginx 不知道。

PHP 应用经典写法

nginx
location / {try_files$uri$uri/ /index.php?$query_string;}location~ \.php$ {fastcgi_pass unix:/run/php/php8.2-fpm.sock;fastcgi_index index.php;include fastcgi_params;fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;}

五、「我的图片为什么 404」标准排查流程

新人最常问的问题之一:「配了 nginx 但图片访问 404,配置看着没问题」。按这个流程排:

Step 1:看 error.log 里的实际路径

bash
sudotail -f /var/log/nginx/error.log# 再访问一次出问题的 URL,等错误打出来

会看到类似:

*123 open() "/var/www/static/static/img/x.png" failed (2: No such file or directory),client: 127.0.0.1, server: demo.local, request: "GET /static/img/x.png HTTP/1.1"

注意 /var/www/static/static/img/x.png——多了一个 static。说明 root 拼接出了重复路径,应该改用 alias 或调整 root。

Step 2:核对 root / alias 配置

nginx
# 假设原配置location /static/ {root /var/www/static;     # ← root 会拼上 location,变成 /var/www/static/static/...}# 修正方案 A:去掉 root 里的 staticlocation /static/ {root /var/www;            # → /var/www/static/img/x.png}# 修正方案 B:用 aliaslocation /static/ {alias /var/www/static/;   # → /var/www/static/img/x.png}

Step 3:文件权限和属主

bash
sudo -u www-data ls /var/www/static/img/x.png# 如果 Permission denied 就是权限问题# Nginx 用户需要:目录有 x(能进入)+ 文件有 r(能读)sudochown -R www-data:www-data /var/www/staticsudochmod -R 755 /var/www/static

Step 4:用 nginx debug 看真实匹配过程(杀手锏)

nginx
# error_log 改成 debug 级别(**仅排查时开**)error_log /var/log/nginx/error.log debug;

reload 后再请求一次,error.log 里会有:

test location: "/static/"using configuration "/static/"http filename: "/var/www/static/img/x.png"

直接告诉你它命中了哪个 location、拼出了什么路径,排错一目了然。


六、internal 与 X-Accel-Redirect:高级用法

location 加 internal 表示只能被内部 rewrite / redirect 进入,不能从外部 URL 直接访问

nginx
location /protected/ {    internal;                                  # 外部 GET /protected/x 直接 404alias /var/www/protected-files/;}location /api/download/ {# 应用做鉴权后,回 X-Accel-Redirect 头给 nginxproxy_pass http://backend;}

后端 PHP / Node 校验通过后回 header X-Accel-Redirect: /protected/big-file.pdfnginx 接到这个头会内部转发到 /protected/ 由它来发文件,应用本身不传文件、不耗带宽——这是大文件下载鉴权的经典模式。


七、配置最佳实践小抄

nginx
server {# ━━ listen ━━listen80;listen [::]:80;                              # 同时听 IPv6# ━━ server_name ━━server_name www.example.com example.com;# ━━ 根路径写在 server 级,全 server 共享 ━━root /var/www/example;index index.html;# ━━ 日志分站点 ━━access_log /var/log/nginx/example.access.log;error_log  /var/log/nginx/example.error.log warn;# ━━ 通用 location ━━location / {try_files$uri$uri/ =404;    }# ━━ 静态资源单独缓存 ━━location~* \.(jpg|png|css|js)$ {expires7d;add_header Cache-Control "public, immutable";    }# ━━ 隐藏文件拒绝访问 ━━location~ /\. {deny all;access_logoff;log_not_foundoff;    }# ━━ 转发 API 到后端 ━━location /api/ {proxy_pass http://127.0.0.1:3000/;       # 注意结尾的 /,下一篇详讲proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;    }}

八、常见错误总结

错误现象
真实原因
怎么改
配置 reload 后没生效
sites-available 改了但没软链到 sites-enabled
ln -s sites-available/x sites-enabled/
图片 404 但配置看着没错
root 拼出重复路径
改用 alias 或调整 root
前端 SPA 路由刷新 404
没配 try_files 兜底
try_files $uri $uri/ /index.html;
多个 location 都该匹配,结果走了不对的
没理解 ^~ 阻断正则、正则按顺序
重新梳理 location 优先级
别人拿 IP 直接打到你的站
没设 default_server 拒绝
加一个 return 444; 的 default
alias 路径拼坏
末尾斜杠不一致
location 和 alias 末尾要么都带 / 要么都不带

写在最后

  • server 选谁,先按 listen 端口,再按 server_name(精确 > 通配 > 正则 > default)
  • location 五优先级背熟
    = > ^~ > ~/~*(按顺序) > 普通前缀(按最长)
  • ^~ 不是「正则」,是「前缀且阻断正则」
  • root 拼接、alias 替换
    ——这一句记牢,95% 的路径问题都能避开
  • alias 必须末尾带 /(如果指向目录)
    ,且只能用在 location 内
  • SPA 项目 location / 里 try_files $uri $uri/ /index.html;是必备
  • 排查路径问题先开 error_log debug,nginx 会告诉你它命中了哪个 location、拼出了什么真实磁盘路径

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-08-21 13:34:26 HTTP/2.0 GET : https://f.mffb.com.cn/a/509703.html
  2. 运行时间 : 0.355575s [ 吞吐率:2.81req/s ] 内存消耗:4,812.62kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=349f903afa0fb577c54bf1db65556e66
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000888s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001659s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.033472s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.008230s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001544s ]
  6. SELECT * FROM `set` [ RunTime:0.000701s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001536s ]
  8. SELECT * FROM `article` WHERE `id` = 509703 LIMIT 1 [ RunTime:0.001107s ]
  9. UPDATE `article` SET `lasttime` = 1787290466 WHERE `id` = 509703 [ RunTime:0.018241s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 67 LIMIT 1 [ RunTime:0.017966s ]
  11. SELECT * FROM `article` WHERE `id` < 509703 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.018166s ]
  12. SELECT * FROM `article` WHERE `id` > 509703 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.000495s ]
  13. SELECT * FROM `article` WHERE `id` < 509703 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.000748s ]
  14. SELECT * FROM `article` WHERE `id` < 509703 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.074964s ]
  15. SELECT * FROM `article` WHERE `id` < 509703 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.093942s ]
0.357263s