nginx - 如何在从 PuPHPet 生成的配置文件中设置 Nginx 重写规则?

标签 nginx vagrant puphpet

来自“config.yaml”文件的示例:

locations:
  ...
  some_location_root:
    location: /
    try_files:
      - $uri
      - '@rwr'

  some_location_rewrite:
    location: '@rwr'
    rewrite: '^(.*) /index.php?_controller=$1 last'
  ...

最佳答案

我在这里找到了解决方案:
https://github.com/jfryman/puppet-nginx/blob/master/spec/defines/resource_location_spec.rb

rewrite: '^(.*) /index.php?_controller=$1 last'

应该看起来像:
rewrite_rules: ['^(.*) /index.php?_controller=$1 last']

关于nginx - 如何在从 PuPHPet 生成的配置文件中设置 Nginx 重写规则?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30011857/

相关文章:

node.js - 使用 Express 显示图像,而不是下载它

virtual-machine - VBox管理 : error: Failed to create the host-only adapter

vagrant - 在Vagrant中,我可以将预配器设置为仅手动运行吗?

css - Nginx 不会在树莓派的 Asp.net 核心上加载 css

nginx - Express.js 使用虚拟路径重定向

linux - nginx 无需 sudo 运行或自动输入密码不需要我输入

vagrant - PuPHPet - Vagrant 错误 : Evaluation Error and non-zero exit

不使用打包在盒子中的 Vagrantfile(通过打包器)

redis - 无法连接到 vagrant 机器上的 redis

linux - Vagrant、Symfony、chmod 许可证