Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 1.31 KB

complex-redirect.md

File metadata and controls

33 lines (23 loc) · 1.31 KB

Ex4 Complex: Redirect, Paths -> Destinations

The example file: complex-redirect.yml has these sections.

refracts

These are more complicated refracts when you need to specify different paths to redirect to different destinations. Under the dsts field each path must start with a / followed by a path to redirect as the key. The value is the desired destination for the redirect.

show

This section shows what the refract looks like after it has been loaded and normalized to the these data fields. If unspecified status will default to 301. Any tests specified will be added to the generated tests. Tests will be generated by suffixing each src with each path specified and expecting the provided destination.

nginx

This shows the nginx that will be generated for this refract. Notice that each path is protected by a location block. By default these are prefixed with = to specify an exact match in nginx spec.

validate

This is the output of the validate step done against a localhost running container. Each test loaded will be used in this step. The destination and status will be compared against the expected destination and status.

Note: remember the status and tests are defaults if unspecified. Here you can see how the tests specify src: dst incorporating the path fragments.