Search code examples
nginxvagrantpuphpet

How do I set up Nginx rewrite rules in a config file generated from PuPHPet?


Example from "config.yaml" file:

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

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

Solution

  • I found the solution here: https://github.com/jfryman/puppet-nginx/blob/master/spec/defines/resource_location_spec.rb

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

    Should look like:

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