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

Feature request: assign nginx location to multiple servers #1135

Closed
hostingnuggets opened this issue Oct 20, 2017 · 4 comments · Fixed by #1231
Closed

Feature request: assign nginx location to multiple servers #1135

hostingnuggets opened this issue Oct 20, 2017 · 4 comments · Fixed by #1231
Labels
enhancement New feature or request

Comments

@hostingnuggets
Copy link

Right now an nginx location config can only be assigned to one single nginx server passing it as a String. It would be nice to be able to define one nginx location and re-use it for multiple nginx servers. This could be done by passing an Array instead of a String. Here is an example of what I mean using hiera YAML config:

nginx::nginx_locations:
  'acme-challenge':
    location: '/.well-known/acme-challenge'
    server: ['www.domain1.com', 'www.domain2.com']

This would avoid having to duplicate nginx location config blocks for multiple websites and hence have a shorter and cleaner config following DRY.

@ekohl ekohl added the enhancement New feature or request label Oct 23, 2017
@kwisatz
Copy link

kwisatz commented Jan 21, 2018

Just look this up, because in a recent set-up, I would have benefited a great deal from this.

@tinuzz
Copy link

tinuzz commented Mar 22, 2018

For this use case, I use

'include_files' => [ 'snippets/letsencrypt-acme-challenge.conf' ],

in all servers.

@dndprude
Copy link

Moving to this module from jfryman-nginx and this functionality was used heavily in our setup. Let's encrypt is far from the only usage case in which multiple vhosts will require the same location definitions.

@ekohl
Copy link
Member

ekohl commented Jun 22, 2018

@dndprude this module was migrated (and renamed) from jfryman-nginx so I'm surprised if the functionality was actually removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants