puppet-nginx icon indicating copy to clipboard operation
puppet-nginx copied to clipboard

use_default_location behavior is undocumented and confusing/counterintuitive

Open cscheib opened this issue 10 years ago • 4 comments

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.

cscheib avatar Jan 05 '15 02:01 cscheib

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?

wyardley avatar Oct 08 '16 05:10 wyardley

btw, we're hoping to start work on documenting the main class in #941

wyardley avatar Nov 07 '16 17:11 wyardley

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 avatar Feb 02 '18 11:02 beezly

@beezly I think the idea is for the module to work "out of the box" with minimal configuration (by setting up that default location).

wyardley avatar Feb 02 '18 22:02 wyardley