Skip to content
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

vhost configuration, www_root and default location #317

Closed
ghost opened this issue May 18, 2014 · 2 comments
Closed

vhost configuration, www_root and default location #317

ghost opened this issue May 18, 2014 · 2 comments

Comments

@ghost
Copy link

ghost commented May 18, 2014

The vhost configuration files that are generated by puppet are sometimes not according to the best practices and sometimes even follow nginx configuration pitfalls ( http://wiki.nginx.org/Pitfalls ). Before I start fixing and filing a PR for this I would first like to discuss if there are any reasons for why this currently works as it does.

The problem that I see and would like to fix:

  1. We ALWAYS have multiple declarations of root (inside all locations, but the server directive never has one).

I would propose including root in resource::vhost would make it appear in server directive. We could still define a location /, but then it would not need root defined in it. For recource::location if www_root in resource::location is relative to vhost's www_root, we can skip it.

I would also propose introducing a parameter which would let you skip default location / declaration if needed. This is extremely useful when you only want to define a vhost for redirecting to another vhost, thus you do not even need any locations defined.

Can I start working on changes, please tell me what you think.

@ghost
Copy link
Author

ghost commented Jan 14, 2015

+1 to this.

Using this module with Owncloud is kind of painful, as it requires the root to be specified inside of the server block and fails to load if root is specified in location /.

Saner behavior, I think, would be using www_root to set root in the server block, as described in the Pitfalls document.

A new (optional) parameter, location_root, should be applied to individual location resources if set. If not, simply don't set it, as it's not required.

@3flex
Copy link
Contributor

3flex commented Apr 13, 2015

This is a duplicate of #142, so I'm closing this in favour of that issue. Please add your +1 there if you feel it's appropriate.

@3flex 3flex closed this as completed Apr 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant