puppet-nginx
puppet-nginx copied to clipboard
use_default_location behavior is undocumented and confusing/counterintuitive
At best, its current default configuration seems a bad default to set - per nginx best practices, you should generally have your document root defined in the "server" stanza rather than the "location" stanza. One should be able to reasonably assume that to be the default behavior. reference
I couldn't find any documentation on this, even at the top of the file, and had to dig into the code to determine why root wasn't being set in the server stanza.
While the default behavior seems counterintuitive to me, it would be acceptable if there were more (any) documentation around the behaviors of this parameter, and how/when to work around them.
I totally agree! At the least, the module should give a more correct (and useful) warning in cases where this causes problems. Or maybe there's a way to see if a '/' location exists for the vhost and suppress the default if so?
btw, we're hoping to start work on documenting the main class in #941
I just hit this too. The lack of documentation isn't great. I am very happy to write a PR for the documentation, but I'm not clear on why you would want the behaviour of use_default_location => true
. Can anyone suggest?
@beezly I think the idea is for the module to work "out of the box" with minimal configuration (by setting up that default location).