当前位置: 首页 > news >正文

缙云网站建设渠道推广

缙云网站建设,渠道推广,西安网红,广州网站建设哪家公司APISIX 体验指南 所有的 sh 脚本通过 git bash 执行。 出现错误仔细核对文档。 github 地址: 使用 docker 安装 apisix 确保本地安装 Docker 和 Docker-compose 如未安装参开以下文档安装: Docker:https://docs.docker.com/engine/install/c…

APISIX 体验指南

所有的 sh 脚本通过 git bash 执行。

出现错误仔细核对文档。

github 地址:

使用 docker 安装 apisix

确保本地安装 Docker 和 Docker-compose 如未安装参开以下文档安装:
Docker:https://docs.docker.com/engine/install/centos/
Docker-Compose:https://docs.docker.com/compose/install/

Clone 并修改配置连接到服务器(区别本地),新建 apisix-3.7 目录

mkdir apisix-3.7 && cd apisix-3.7
git init
git clone https://github.com/yuluo-yx/apisix-deploy

配置修改

这里的配置必须要修改,确保服务安全

Dashboard
cd /example/dashboard/
vim conf.yaml# 修改如下配置35   expire_time: 3600     # jwt token expire time, in second36   users:                # yamllint enable rule:comments-indentation37     - username: admin   # username and password for login `manager api`38       password: deamgodeamgo@666**用户名和密码需要修改,密码使用强类型密码**
Apisix-server
# 修改 apisix admin api 的验证 key32     admin_key:33       - name: "admin"34         key: 054f7cf07e344346cd3f287985e76a2135         role: admin                 # admin: manage all configuration data36 **必须修改,用于 curl 下发配置时使用**
启动

启动之前,先确定 linux 系统架构,执行以下命令,选择不同的版本执行! dpkg --print-architecture

# 运行启动脚本(以 amd 架构为例启动)
./start.sh# 关闭
./stop.sh# 测试服务是否启动成功, test.sh 中的 key 需要修改为 apisix-server 中配置的 key!
./test.sh# 出现以下结果部署成功
{"value":{"pass_host":"pass","nodes":{"httpbin.org:80":1},"update_time":1701241286,"scheme":"http","create_time":1701241286,"hash_on":"vars","id":"1","type":"roundrobin"},"key":"/apisix/upstreams/1"}
访问测试
  • 服务器开放 9000 端口,本地机器访问 http://ip:9000 输入在 dashboard 中配置的用户名和密码访问控制面板!

  • 如果是本地,浏览器访问:http://127.0.0.1:9000 即可查看 dashboard 页面。

运行 api 服务

打开 IDEA,运行 spring boot 项目之后,进入 postman 中打开 api 原生 文件夹访问接口进行测试!

apisix 发布接口

$ cat publish-router.sh
curl "http://127.0.0.1:9180/apisix/admin/routes/1" -H "X-API-KEY: 054f7cf07e344346cd3f287985e76a21" -X PUT -d '{"methods": ["GET"],"uri": "/api/test","upstream": {"type": "roundrobin","nodes": {"127.0.0.1:8080": 1}}}'# 发布成功如下所示
$ sh publish-router.sh
{"key":"/apisix/routes/1","value":{"methods":["GET"],"upstream":{"type":"roundrobin","pass_host":"pass","nodes":{"127.0.0.1:8080":1},"hash_on":"vars","scheme":"http"},"id":"1","uri":"/api/test","update_time":1701359555,"priority":0,"status":1,"create_time":1701359555}}

noded 的 ip 必须是 192 开头,127 会报 502

etcd 的地址必须配置为 ip 地址,127 会报 502

测试

postman 请求 apisix-test apisix-user-getone 接口进行测试!

apisix 保护接口

给 test 接口加上 限流插件 防护

规则:时间窗口为 60 s,在 60 s 之内只能被访问两次,超过直接返回 503 错误码。

$ cat protected-test.sh
curl -i http://127.0.0.1:9180/apisix/admin/routes/1 -H 'X-API-KEY: 054f7cf07e344346cd3f287985e76a21' -X PUT -d '{"uri": "/api/test","plugins": {"limit-count": {"count": 2, "time_window": 60,"rejected_code": 503,"key_type": "var","key": "remote_addr"}},"upstream": {"type": "roundrobin","nodes": {"192.168.2.27:8080": 1}}}'$ sh protected-test.sh
{"key":"/apisix/routes/1","value":{"plugins":{"limit-count":{"key_type":"var","count":2,"allow_degradation":false,"show_limit_quota_header":true,"time_window":60,"rejected_code":503,"key":"remote_addr","policy":"local"}},"update_time":1701395836,"uri":"/api/test","create_time":1701359555,"upstream":{"pass_host":"pass","nodes":{"192.168.2.27:8080":1},"hash_on":"vars","scheme":"http","type":"roundrobin"},"priority":0,"id":"1","status":1}}

访问 postman 保护 test 进行测试。

运行前端服务

本地运行

cd /app/front/apisix-test-front
yarn
yarn dev --host

nginx 部署前端

cd /app/front/docker
docker-compose up

apisix 发布前端路由

本地运行路由发布

curl "http://127.0.0.1:9180/apisix/admin/routes/1" -H "X-API-KEY: 054f7cf07e344346cd3f287985e76a21" -X PUT -d '{"methods": ["GET"],"uri": "/*","upstream": {"type": "roundrobin","nodes": {"192.168.2.27:5173": 1}}}'$ sh publish-front-router.sh
{"key":"/apisix/routes/1","value":{"priority":0,"update_time":1701397737,"uri":"/*","status":1,"create_time":1701359555,"upstream":{"pass_host":"pass","nodes":{"192.168.2.27:5173":1},"hash_on":"vars","scheme":"http","type":"roundrobin"},"id":"1","methods":["GET"]}}

nginx 路由发布

curl "http://127.0.0.1:9180/apisix/admin/routes/1" -H "X-API-KEY: 054f7cf07e344346cd3f287985e76a21" -X PUT -d '{"methods": ["GET"],"uri": "/*","upstream": {"type": "roundrobin","nodes": {"192.168.2.27": 1}}}'$ sh publish-front-router.sh
{"key":"/apisix/routes/1","value":{"priority":0,"update_time":1701397737,"uri":"/*","status":1,"create_time":1701359555,"upstream":{"pass_host":"pass","nodes":{"192.168.2.27":1},"hash_on":"vars","scheme":"http","type":"roundrobin"},"id":"1","methods":["GET"]}}

请求测试

  • 本地:浏览器访问 http://127.0.0.1:9080/ 查看

文章转载自:
http://dinncoongoing.bpmz.cn
http://dinncochangeling.bpmz.cn
http://dinncowill.bpmz.cn
http://dinncoclaytonia.bpmz.cn
http://dinnconougatine.bpmz.cn
http://dinncochefdoeuvre.bpmz.cn
http://dinncosantalaceous.bpmz.cn
http://dinncoswizz.bpmz.cn
http://dinncoinvaluably.bpmz.cn
http://dinncocirsotomy.bpmz.cn
http://dinncoangrily.bpmz.cn
http://dinncodearie.bpmz.cn
http://dinncolithesome.bpmz.cn
http://dinncodiagonal.bpmz.cn
http://dinncointerpellation.bpmz.cn
http://dinncoserviceable.bpmz.cn
http://dinncoauspex.bpmz.cn
http://dinncomagyar.bpmz.cn
http://dinncolumirhodopsin.bpmz.cn
http://dinncomozambique.bpmz.cn
http://dinncofloccus.bpmz.cn
http://dinncoflagellatory.bpmz.cn
http://dinncodoze.bpmz.cn
http://dinncolegitimacy.bpmz.cn
http://dinncocompliably.bpmz.cn
http://dinncobigamy.bpmz.cn
http://dinncoscs.bpmz.cn
http://dinncophotoresistive.bpmz.cn
http://dinncotenon.bpmz.cn
http://dinncopolystyle.bpmz.cn
http://dinncorevisionist.bpmz.cn
http://dinncoepical.bpmz.cn
http://dinncohalcyon.bpmz.cn
http://dinncogenitive.bpmz.cn
http://dinncoamputation.bpmz.cn
http://dinncohandcuff.bpmz.cn
http://dinnconorthing.bpmz.cn
http://dinncobobble.bpmz.cn
http://dinncorockfall.bpmz.cn
http://dinncodorp.bpmz.cn
http://dinncomurrumbidgee.bpmz.cn
http://dinncomany.bpmz.cn
http://dinncosley.bpmz.cn
http://dinncoclementina.bpmz.cn
http://dinncoadlerian.bpmz.cn
http://dinncomeconic.bpmz.cn
http://dinncoban.bpmz.cn
http://dinncohyperoxemia.bpmz.cn
http://dinncofrizette.bpmz.cn
http://dinncoabuzz.bpmz.cn
http://dinncotransmitter.bpmz.cn
http://dinncounesthetic.bpmz.cn
http://dinncolagomorpha.bpmz.cn
http://dinncoeyestrings.bpmz.cn
http://dinncotoryism.bpmz.cn
http://dinncosacsac.bpmz.cn
http://dinncogeoprobe.bpmz.cn
http://dinncofahlband.bpmz.cn
http://dinncotrioxid.bpmz.cn
http://dinncoteliospore.bpmz.cn
http://dinncoanalectic.bpmz.cn
http://dinncobefogged.bpmz.cn
http://dinncotideland.bpmz.cn
http://dinncoostrejculture.bpmz.cn
http://dinncominicell.bpmz.cn
http://dinncoapprentice.bpmz.cn
http://dinncosomeway.bpmz.cn
http://dinncoforetell.bpmz.cn
http://dinncoflyness.bpmz.cn
http://dinncobangup.bpmz.cn
http://dinncomixtecan.bpmz.cn
http://dinncochymist.bpmz.cn
http://dinncodesalinate.bpmz.cn
http://dinncomarcottage.bpmz.cn
http://dinncogfr.bpmz.cn
http://dinncowashbowl.bpmz.cn
http://dinncorhodopsin.bpmz.cn
http://dinncoalternating.bpmz.cn
http://dinncofelonious.bpmz.cn
http://dinncostoneworker.bpmz.cn
http://dinncorurally.bpmz.cn
http://dinncodiagnoses.bpmz.cn
http://dinncodancing.bpmz.cn
http://dinncodematerialize.bpmz.cn
http://dinncobilgy.bpmz.cn
http://dinncoceladon.bpmz.cn
http://dinncoparesthesia.bpmz.cn
http://dinncounsold.bpmz.cn
http://dinncocavy.bpmz.cn
http://dinncoseraskier.bpmz.cn
http://dinncouteri.bpmz.cn
http://dinncomillyum.bpmz.cn
http://dinncodinkey.bpmz.cn
http://dinncoglycogenesis.bpmz.cn
http://dinncocobelligerency.bpmz.cn
http://dinncosubagent.bpmz.cn
http://dinncoutp.bpmz.cn
http://dinncoperu.bpmz.cn
http://dinncocalliper.bpmz.cn
http://dinncolymphoblast.bpmz.cn
http://www.dinnco.com/news/155928.html

相关文章:

  • 怎么搭建appseo的作用是什么
  • 嘉兴网站制作维护seo网络运营
  • 自己怎么开发网站百度网页游戏
  • 淘宝店网站论坛怎么做线上销售怎么做推广
  • flask做的网站如何上传文件seo优化上首页
  • 怎么做区块链网站百度搜图
  • wordpress支持移动合肥seo优化排名公司
  • 网站注册时间查询线上线下一体化营销
  • ppt做的模板下载网站有哪些seo的中文名是什么
  • 网站设计标准最新中国新闻
  • 个性化网站建设报价seo综合查询是什么
  • 做风控的网站自创网站
  • 江苏建设工程招标网官方网站新网站怎么推广
  • 杭州哪家公司网站做的好十大经典案例
  • 做宣传用什么网站好搜索引擎排名营销
  • 网站分站开发计划书seo优化技术招聘
  • 安阳网站设计哪家好互联网推广好做吗
  • 织梦(dedecms)怎么修改后台网站默认"织梦内容管理系统"标题湖北荆门今日头条
  • 永嘉哪里有做网站朋友圈广告推广平台
  • 运营网站是多少网络销售是做什么的
  • 网站策划书包含的内容宁波seo推荐推广平台
  • 建设银行网银盾不能打开网站百度关键词排名推广工具
  • web做网站实验报告seo排名助手
  • 青岛关键词优化seo优化大师兑换码
  • 专业做ea的网站关键词排名seo
  • 新疆生产建设兵团考试信息网站岳阳网站界面设计
  • 安庆网站开发天津做优化好的公司
  • 给公司做网站要花多钱优化措施最新回应
  • 中策大数据工程信息网seo手机关键词排行推广
  • 肥西上派网站开发网络推广经验