-
-
Notifications
You must be signed in to change notification settings - Fork 883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot create location with only try_files defined #470
Comments
Actually you can do it using location_custom_cfg:
resulting in:
|
This is already possible through location_custom_cfg with a manifest that looks like: nginx::resource::location { 'location name': location => '/', vhost => 'any vhost', location_custom_cfg => { 'try_files' => '$uri $uri/ @rewrite', } } This change simplifies the part by allowing to use the try_files directive on its own (without only in combination with, e.g., www_root): nginx::resource::location { 'location name': location => '/', vhost => 'any vhost', try_files' => [ '$uri', '$uri/', '@rewrite' ], } That looks a bit better as know the user doesn't need to think about, if he can use try_files or need to use location_custom_cfg in the current context, anymore. fixes voxpupuli#470
#834 implements a possible solution, however, I'm not so happy with it at all. The main reason is, that there're some other valid cases, where only one other directive is possible, too, such as rewrite. Maybe we should take this into account and create a separate template for these valid cases on it's own? Such as the empty.erb but without the location_custom_cfg processing and a set of valid other options (try_files, rewrite, ... (are there any more?)). Ideas? Opinions? |
This is already possible through location_custom_cfg with a manifest that looks like: nginx::resource::location { 'location name': location => '/', vhost => 'any vhost', location_custom_cfg => { 'try_files' => '$uri $uri/ @rewrite', } } This change simplifies the part by allowing to use the try_files directive on its own (without only in combination with, e.g., www_root): nginx::resource::location { 'location name': location => '/', vhost => 'any vhost', try_files' => [ '$uri', '$uri/', '@rewrite' ], } That looks a bit better as know the user doesn't need to think about, if he can use try_files or need to use location_custom_cfg in the current context, anymore. fixes voxpupuli#470
This is already possible through location_custom_cfg with a manifest that looks like: nginx::resource::location { 'location name': location => '/', vhost => 'any vhost', location_custom_cfg => { 'try_files' => '$uri $uri/ @rewrite', } } This change simplifies the part by allowing to use the try_files directive on its own (without only in combination with, e.g., www_root): nginx::resource::location { 'location name': location => '/', vhost => 'any vhost', try_files' => [ '$uri', '$uri/', '@rewrite' ], } That looks a bit better as know the user doesn't need to think about, if he can use try_files or need to use location_custom_cfg in the current context, anymore. fixes voxpupuli#470
This is already possible through location_custom_cfg with a manifest that looks like: nginx::resource::location { 'location name': location => '/', vhost => 'any vhost', location_custom_cfg => { 'try_files' => '$uri $uri/ @rewrite', } } This change simplifies the part by allowing to use the try_files directive on its own (without only in combination with, e.g., www_root): nginx::resource::location { 'location name': location => '/', vhost => 'any vhost', try_files' => [ '$uri', '$uri/', '@rewrite' ], } That looks a bit better as know the user doesn't need to think about, if he can use try_files or need to use location_custom_cfg in the current context, anymore. fixes voxpupuli#470
The check for creating a resource does not check to see if try_files is defined which alone could be used to create a valid location reference.
For example in wordpress if you want to forward rewrites to index.php you would need the following
The text was updated successfully, but these errors were encountered: