nginx 配置 apple-app-site-association

怼烎@ 2022-10-15 09:00 212阅读 0赞

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

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

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

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

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

发表评论

表情:
评论列表 (有 0 条评论,212人围观)

还没有评论,来说两句吧...

相关阅读

    相关 nginx配置

    1.worker\_processes 定义了nginx对外提供web服务时的worder进程数。最优值取决于许多因素,包括(但不限于)CPU核的数量、存储数据的硬盘数量及负

    相关 nginx配置

    nginx配置 nginx常用编译参数 对于nginx,如果使用源码安装,在进行./configure编译的时候,需要为其指定一些参数。 –prefix=P