基于nginx 动态 URL反向代理的实现

背景:

        我们在项目中在这样一个场景,用户需要使用固定的软件资源,这些资源是以服务器或者以容器形式存在的。

        资源以webAPI方式在内网向外提供接口,资源分类多种类型,每种类型的资源程序和Wapi参数都一样。这些资源部属完成后使用IP+端口进行区分。如下表所示

     

技术分析:

经过调研分析,发现Nginx 可以进行么向代理,代理后可以进行调度到内部的数据

技术验证:

1.使用静态方式在配置文件中直接写入

如下:

server {listen        22280;server_name  localhost;root   "D:/dist";location / {index index.php index.html error/index.html;error_page 400 /error/400.html;error_page 403 /error/403.html;error_page 404 /error/404.html;error_page 500 /error/500.html;error_page 501 /error/501.html;error_page 502 /error/502.html;error_page 503 /error/503.html;error_page 504 /error/504.html;error_page 505 /error/505.html;error_page 506 /error/506.html;error_page 507 /error/507.html;error_page 509 /error/509.html;error_page 510 /error/510.html;#include D:/Git/111/nginx.htaccess;autoindex  off;try_files $uri $uri/ @router; #需要指向下面的@router否则会出现vue的路由在nginx中刷新出现404index  index.html index.htm;}#反向代理 location /r1/ {     proxy_pass http://192.168.1.88:888/;            }location /r2/ {     proxy_pass http://192.168.1.88:887/;            }location /i1/ {     proxy_pass http://192.168.1.89:3333/;            }location /i2/ {     proxy_pass http://192.168.1.90:3333/;            }#对应上面的@router,主要原因是路由的路径资源并不是一个真实的路径,所以无法找到具体的文件#因此需要rewrite到index.html中,然后交给路由在处理请求资源location @router {rewrite ^.*$ /index.html last;}location ~ \.php(.*)$ {fastcgi_pass   127.0.0.1:9000;fastcgi_index  index.php;fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;fastcgi_param  PATH_INFO  $fastcgi_path_info;fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;include        fastcgi_params;}
}

使用此方式可以达到所需效果,但如果资源变化需要手动调整Nginx的配置文件。因此考虑有没有一种办法可以做到动态转发呢?

问题难点:

1.资源需要一定的规律性

2.nginx动态转发功能技术上需要进行预研,明确是否可行

实现过程:

1.确定方案

方案里我们准备采用 固定内容+端口号的形式来进行处理,在此之前我们需要把服务用K8S映射到

同一IP或者同一规则的内容上。并且对URL进行了定义 /rs/(\d+)/实际API  的形式进行调用

2.方案实现

我们假定所有的 k8s 把所有的服务地址都映射到了 192.168.1.88上,仅端口不同,使用不同的端口就可以调度到不同的服务。

部分配置如下:

		location /rs/(\d.+)/ {     proxy_pass http://localhost:$/;            }

运行报错 http 500

500 Internal Server Error
nginx/1.15.11
问题处理:
2024/03/22 17:07:35 [error] 5072#34752: *264 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:07:35 [error] 5072#34752: *265 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:08:15 [error] 5072#34752: *268 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:08:16 [error] 5072#34752: *269 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:08:16 [error] 5072#34752: *270 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:08:17 [error] 5072#34752: *271 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:09:24 [error] 5072#34752: *273 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:09:24 [error] 5072#34752: *274 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:09:25 [error] 5072#34752: *275 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:09:26 [error] 5072#34752: *276 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:09:27 [error] 5072#34752: *277 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:09:27 [error] 5072#34752: *278 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:09:35 [error] 5072#34752: *283 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:09:36 [error] 5072#34752: *284 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:09:36 [error] 5072#34752: *285 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:09:37 [error] 5072#34752: *286 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:09:38 [error] 5072#34752: *287 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:09:38 [error] 5072#34752: *288 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280"
2024/03/22 17:10:00 [error] 5072#34752: *279 upstream prematurely closed connection while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /uuu/60000/api/sysAuth/index.html HTTP/1.1", upstream: "http://192.168.27.51:60000/", host: "127.0.0.1:280"
2024/03/22 17:10:00 [error] 5072#34752: *279 rewrite or internal redirection cycle while processing "/index.html", client: 127.0.0.1, server: localhost, request: "GET /uuu/60000/api/sysAuth/index.html HTTP/1.1", upstream: "http://192.168.27.51:60000/", host: "127.0.0.1:280"
2024/03/22 17:10:01 [error] 5072#34752: *280 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280", referrer: "http://127.0.0.1:280/uuu/60000/api/sysAuth/index.html"
2024/03/22 17:11:05 [error] 5072#34752: *290 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /uuu/60000/api/sysAuth/index.html HTTP/1.1", upstream: "http://192.168.27.51:60000/", host: "127.0.0.1:280"
2024/03/22 17:11:05 [error] 5072#34752: *290 rewrite or internal redirection cycle while processing "/index.html", client: 127.0.0.1, server: localhost, request: "GET /uuu/60000/api/sysAuth/index.html HTTP/1.1", upstream: "http://192.168.27.51:60000/", host: "127.0.0.1:280"
2024/03/22 17:11:05 [error] 5072#34752: *293 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "127.0.0.1:280", referrer: "http://127.0.0.1:280/uuu/60000/api/sysAuth/index.html"
2024/03/22 17:14:18 [error] 8748#17732: *1 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /uuu/60000/index.html HTTP/1.1", upstream: "http://192.168.27.51:60000/uuu/60000/index.html", host: "localhost:280"
2024/03/22 17:14:18 [error] 8748#17732: *1 rewrite or internal redirection cycle while processing "/index.html", client: 127.0.0.1, server: localhost, request: "GET /uuu/60000/index.html HTTP/1.1", upstream: "http://192.168.27.51:60000/uuu/60000/index.html", host: "localhost:280"
2024/03/22 17:14:19 [error] 8748#17732: *5 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:280", referrer: "http://localhost:280/uuu/60000/index.html"
2024/03/22 17:15:59 [error] 12116#31400: *4 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /uuu/60000/aaaa HTTP/1.1", upstream: "http://192.168.27.51:60000/", host: "localhost:280"
2024/03/22 17:15:59 [error] 12116#31400: *4 rewrite or internal redirection cycle while processing "/index.html", client: 127.0.0.1, server: localhost, request: "GET /uuu/60000/aaaa HTTP/1.1", upstream: "http://192.168.27.51:60000/", host: "localhost:280"
2024/03/22 17:15:59 [error] 12116#31400: *7 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:280", referrer: "http://localhost:280/uuu/60000/aaaa"
2024/03/22 17:20:20 [error] 33904#20644: *1 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while reading response header from upstream, client: 127.0.0.1, server: localhost, request: "GET /uuu/60000/api/sysAuth/captcha HTTP/1.1", upstream: "http://192.168.27.51:60000/", host: "localhost:280"
2024/03/22 17:20:20 [error] 33904#20644: *1 rewrite or internal redirection cycle while processing "/index.html", client: 127.0.0.1, server: localhost, request: "GET /uuu/60000/api/sysAuth/captcha HTTP/1.1", upstream: "http://192.168.27.51:60000/", host: "localhost:280"
2024/03/22 17:20:20 [error] 33904#20644: *4 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:280", referrer: "http://localhost:280/uuu/60000/api/sysAuth/captcha"
2024/03/22 17:24:31 [error] 41040#27804: *2 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /favicon.ico HTTP/1.1", host: "localhost:280", referrer: "http://localhost:280/uuu/5257/api/sysAuth/captcha"
2024/03/22 17:24:35 [error] 41040#27804: *4 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /_framework/aspnetcore-browser-refresh.js HTTP/1.1", host: "localhost:280", referrer: "http://localhost:280/uuu/5257/index.html"
2024/03/22 17:24:35 [error] 41040#27804: *11 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /index-mini-profiler/includes.min.js?v=4.3.8+1120572909 HTTP/1.1", host: "localhost:280", referrer: "http://localhost:280/uuu/5257/index.html"
2024/03/22 17:24:35 [error] 41040#27804: *12 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /_vs/browserLink HTTP/1.1", host: "localhost:280", referrer: "http://localhost:280/uuu/5257/index.html"
2024/03/22 17:24:35 [error] 41040#27804: *13 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /swagger/%E5%85%AC%E5%85%B1%E6%9C%8D%E5%8A%A1/swagger.json HTTP/1.1", host: "localhost:280", referrer: "http://localhost:280/uuu/5257/index.html"
2024/03/22 17:35:40 [error] 41512#41416: *8 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /_framework/aspnetcore-browser-refresh.js HTTP/1.1", host: "localhost:280", referrer: "http://localhost:280/area/5257/index.html"
2024/03/22 17:35:40 [error] 41512#41416: *10 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /_vs/browserLink HTTP/1.1", host: "localhost:280", referrer: "http://localhost:280/area/5257/index.html"
2024/03/22 17:35:40 [error] 41512#41416: *9 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /index-mini-profiler/includes.min.js?v=4.3.8+1120572909 HTTP/1.1", host: "localhost:280", referrer: "http://localhost:280/area/5257/index.html"
2024/03/22 17:35:40 [error] 41512#41416: *2 rewrite or internal redirection cycle while redirect to named location "@router", client: 127.0.0.1, server: localhost, request: "GET /swagger/%E5%85%AC%E5%85%B1%E6%9C%8D%E5%8A%A1/swagger.json HTTP/1.1", host: "localhost:280", referrer: "http://localhost:280/area/5257/index.html"

通过日志发现存在循环引用之类的

考虑使用URL重写改变下,路径。再使用proxy_pass反向代理。尝试修改nginx并进行修改。

问题解决
location ~ ^/rs/(\d.+)/{rewrite ^/rs/(\d+)/(.*)$ /$2 break;proxy_pass http://192.168.1.88:$1;  }

最终结果能够正常转发到指定端口,并且nginx 也不用修改配置,实现了动态端口反向代理。

在这个过程中我发现要实现/dir/port/xxx 这种进行反向代理必须与url重写结合使用。不然会报404.

完整能够成功运行的配置nginx.conf如下

server {listen        22280;server_name  localhost;root   "D:/dist";location / {index index.php index.html error/index.html;error_page 400 /error/400.html;error_page 403 /error/403.html;error_page 404 /error/404.html;error_page 500 /error/500.html;error_page 501 /error/501.html;error_page 502 /error/502.html;error_page 503 /error/503.html;error_page 504 /error/504.html;error_page 505 /error/505.html;error_page 506 /error/506.html;error_page 507 /error/507.html;error_page 509 /error/509.html;error_page 510 /error/510.html;#include D:/Git/111/nginx.htaccess;autoindex  off;try_files $uri $uri/ @router; #需要指向下面的@router否则会出现vue的路由在nginx中刷新出现404index  index.html index.htm;}#反向代理 location ~ ^/rs/(\d.+)/{rewrite ^/rs/(\d+)/(.*)$ /$2 break;proxy_pass http://192.168.1.88:$1;  }#对应上面的@router,主要原因是路由的路径资源并不是一个真实的路径,所以无法找到具体的文件#因此需要rewrite到index.html中,然后交给路由在处理请求资源location @router {rewrite ^.*$ /index.html last;}location ~ \.php(.*)$ {fastcgi_pass   127.0.0.1:9000;fastcgi_index  index.php;fastcgi_split_path_info  ^((?U).+\.php)(/?.+)$;fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;fastcgi_param  PATH_INFO  $fastcgi_path_info;fastcgi_param  PATH_TRANSLATED  $document_root$fastcgi_path_info;include        fastcgi_params;}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/287514.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

STL —— string(3)

目录 1. 使用 1.1 c_str() 1.2 find() & rfind() 1.3 substr() 1.4 打印网址的协议域名等 1.5 find_first_of() 2. string() 模拟实现 2.1 构造函数的模拟实现 2.2 operator[] 和 iterator 的模拟实现 2.3 push_back() & append() & 的模拟实现 2.4 ins…

sqlite3嵌入式开发板命令行方式使用

如何在编译嵌入式版本的sqlite3,请看我上一篇文章 sqlite3 交叉编译-CSDN博客 一、sqlite3命令行方式使用 假如我将编译好的嵌入式的sqlite3放置在如下路径: 进入bin目录进行操作 1.运行sqlite3 运行sqlite3有两种方式 1)直接在内存里面…

零拷贝技术、常见实现方案、Kafka中的零拷贝技术的使用、Kafka为什么这么快

目录 1. 普通拷贝 2. 数据拷贝基础过程 2.1 仅CPU方式 2.2 CPU&DMA方式 3.普通模式数据交互 4. 零拷贝技术 4.1 出现原因 4.2 解决思路 4.2.1 mmap方式 4.2.2 sendfile方式 4.2.3 sendfileDMA收集 4.2.4 splice方式 5. Kafka中使用到的零拷贝技术 参考链接 本…

Intellij IDEA构建Android开发环境

Intellij IDEA创建项目时没有Android的选项 进设置(Intellij IDEA - Settings - Plugins ) 再次创建项目可以看到Android的选项 解决Android导入项目时Gradle下载速度慢/超时/失败

OpenHarmony内核编程实战

在正式开始之前,对于刚接触OpenHarmony的伙伴们,面对大篇幅的源码可能无从下手,不知道怎么去编码写程序,下面用一个简单的例子带伙伴们入门。 ▍任务 编写程序,让开发板在串口调试工具中输出”Hello,Open…

java Web会议信息管理系统 用eclipse定制开发mysql数据库BS模式java编程jdbc

一、源码特点 jsp 会议信息管理系统是一套完善的web设计系统,对理解JSP java SERLVET mvc编程开发语言有帮助,系统具有完整的源代码和数据库,系统主要采用B/S模式开发。开发环境为TOMCAT7.0,eclipse开发,数据库为Mysql5.0&am…

嵌入式|蓝桥杯STM32G431(HAL库开发)——CT117E学习笔记11:数字电位器MCP4017

系列文章目录 嵌入式|蓝桥杯STM32G431(HAL库开发)——CT117E学习笔记01:赛事介绍与硬件平台 嵌入式|蓝桥杯STM32G431(HAL库开发)——CT117E学习笔记02:开发环境安装 嵌入式|蓝桥杯STM32G431(…

一周是一年的2%

今天读到阮一峰的293期周刊,其中有句话很让我震动——“一周是一年的2%”。 过去的时间里,我都没有在意时间的流逝,过的好的时候就觉得一周过的好快,周三一过这周也就过去了,过的不好的时候就感觉很漫长。 确实&…

C# wpf 嵌入hwnd窗口

WPF Hwnd窗口互操作系列 第一章 嵌入Hwnd窗口(本章) 第二章 嵌入WinForm控件 第三章 嵌入WPF控件 文章目录 WPF Hwnd窗口互操作系列前言一、如何实现1、继承HwndHost2、实现抽象方法3、xaml中使用HwndHost控件 二、具体实现1、Win32窗口2、HwndSource窗…

【Python】搭建 Python 环境

目 录 一.安装 Python二.安装 PyCharm 要想能够进行 Python 开发,就需要搭建好 Python 的环境 需要安装的环境主要是两个部分: 运行环境: Python开发环境: PyCharm 一.安装 Python (1) 找到官方网站 (2) 找到下载页面 选择 “Download for Windows”…

PHPCMS v9城市分站插件

PHPCMS自带的有多站点功能,但是用过的朋友都知道,自带的多站点功能有很多的不方便之处,例如站点栏目没法公用,每个站点都需要创建模型、每个站点都需要单独添加内容,还有站点必须静态化。如果你内容很多这些功能当然无…

Unity VisionOS开发流程

Unity开发环境 Unity Pro, Unity Enterprise and Unity Industry 国际版 Mac Unity Editor(Apple silicon) visionOS Build Support (experimental) 实验版 Unity 2022.3.11f1 NOTE: 国际版与国服版Pro账通用,需要激活Pro的许可证。官方模板v0.6.2,非Pro版本会打…

安科瑞智慧安全用电综合解决方案

概述 智慧用电管理云平台是智慧城市建设的延伸成果,将电力物联网技术与云平台的大数据分析功能相结合,实现用电信息的可视化管理,可帮助用户实现安全用电,节约用电,可靠用电。平台支持web,app,微…

【回眸】Tessy 单元测试软件使用指南(三)怎么打桩和指针赋值和测试

目录 前言 Tessy 如何进行打桩操作 普通桩 高级桩 手写桩 Tessy单元测试之指针相关测试注意事项 有类型的指针(非函数指针): 有类型的函数指针: void 类型的指针: 结语 前言 进行单元测试之后,但凡…

zookeeper面试题

文章目录 ZooKeeper 是什么?ZooKeeper 提供什么?1. 文件系统2. 通知机制 ZooKeeper 文件系统四种类型的 znode1. PERSISTENT (持久化目录节点)2. PERSISTENT_SEQUENTIAL (持久化顺序编号目录节点)3. EPHEMERAL (临时目录节点)4. EPHEMERAL_SEQUENTIAL (临…

C语言------指针(2)

前面已经向大家介绍了指针的一些基本内容,接下来,就在再我来先大家讲解一下指针的其他内容。 1. 数组名的理解 int arr[10] { 1,2,3,4,5,6,7,8,9,10 }; 在学习数组的过程中,我们肯定会写过以上代码,我们知道 int 是该数组的数…

【C语言】C语言运算符优先级详解

文章目录 📝前言🌉运算符优先级简述 🌠逻辑与和逻辑或🌉赋值和逗号运算符 🌠位运算🌉条件表达式🌉位运算与算术运算结合🌉混合使用条件表达式和赋值运算符🌉 逗号运算符的…

UE5、CesiumForUnreal实现海量POI撒点显示与聚合功能

1.实现目标 POI是UE+GIS三维场景中经常需要展示的要素,在UE中常用的表示POI方法有两种。一种是Mesh,即空间的方式;另一种是Widget,即屏幕上的方式,本文这里使用的是Widget屏幕展示的形式来表示POI。 本文这里使用的POI点位数量共3.3w+,采用直接网格聚合算法,并进行性能优…

Chrome/Edge 使用 Markdown Viewer 查看 Markdown 格式文件

Chrome/Edge 使用 Markdown Viewer 查看 Markdown 格式文件 0. 引言1. 安装 Markdown Viewer 插件2. 使用 Markdown Viewer 阅读 Markdown 格式文件 0. 引言 大部分程序员都喜欢 Markdown 格式的文件,这时给一些没有在电脑上安装 Markdown 编辑器的同事分享资料时&…

苹果与百度合作,将在iPhone 16中使用生成式AI

3月25日,《科创板日报》消息,苹果将与百度进行技术合作,为今年即将发布的iPhone16、Mac系统和iOS 18提供生成式AI(AIGC)功能。 据悉,苹果曾与阿里巴巴以及另外一家国产大模型厂商进行了技术合作洽谈。最终…