redirect - 在外部文件中重写规则 nginx
问题描述
我正在尝试使用 nginx 重定向一些特定的 url,当我放置规则时我有一个文件,然后我在主机上有一个包含行
myfile.txt(路径是/home/user/Documents/myfile.txt)
rewrite http://mydomain.io/manuales/Manuales/10-BLD1001RGB/files/assets/basic-html/flipbook.html https://mydomain.io/manuales/Manuales/10-BLD1001RGB/files/assets/basic-html/flipbook.html permanent;
在我的主机上
include /home/user/Documents/myfile.txt;
并且不工作,但问题是我有一些其他文件并且工作正常:我有 redirects.txt 相同的路径和这个规则
rewrite ^/10-downlight https://mydomain.io/es/10-focos-circulares permanent;
工作正常。任何想法??
让我说一下这个例子是在本地主机中,因为我在文件上写了规则并且系统管理员在服务器上应用,我没有权限在服务器上编辑主机
解决方案
推荐阅读
- php - 根据用户设置的另一个表列值查询表列?
- javascript - 如何阻止光标跳到输入的末尾
- firebase - (Vue js和firebase实时数据库)没有记录的用户如何使用规则将数据发送到firebase
- excel - 在word文档末尾添加图片
- imagemagick - 如何使用 ImageMagick 转换标题功能打印反斜杠?
- javascript - SVG条形图轴标注
- .net-core - Net Core MVC - 布局方法调用
- java - 如何从java中的随机整数变量中只选择一个值?
- plc - FBD for TwinCat Beckhoff... 功能块输入输出 这是如何工作的
- c# - .net核心中的InsertOne mongodb不返回结果