当前位置: 代码迷 >> 综合 >> nginx 配置 apple-app-site-association
  详细解决方案

nginx 配置 apple-app-site-association

热度:84   发布时间:2023-12-27 01:54:15.0

参考文章:https://www.jianshu.com/p/723a7fa95257

https://www.jianshu.com/p/3a46eb4a107f

ios突然给我发了如上链接和一个json,说他那边需要放一个 apple-app-site-association 文件用来支持他那边的功能,文件不需要后缀。先说一下要求:线上官网的地址后面跟上他所需要文件的地址,比如 www.baidu.com/apple-app-site-association,可以下载该文件。
开始配置:
首先打开服务器nginx的配置文件,在站点的配置下加一个 location 入口

location /apple-app-site-association {charset UTF-8;default_type application/octet-stream;return 200 '{\"applinks\":{\"apps\":[],\"details\":[{\"appID\":\"xxxxxxxxxxxxxxxxx\",\"paths\":[\"/*\"]}]}}';}

访问官网链接 www.baidu.com/apple-app-site-association 即可直接下载
如果想要打开页面展示里面的文本信息 需要更改default_type text/html;会将这个视为html文件直接打开。

  相关解决方案