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

locations_defaults do not affect the default location in a nginx::resource::server #1516

Open
pier4r opened this issue Sep 14, 2022 · 0 comments

Comments

@pier4r
Copy link

pier4r commented Sep 14, 2022

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 4 or 7
  • Ruby: the ones coming with puppet 4 or 7
  • Distribution: centos 7
  • Module version: v3.3.0 but I also checked the code for v4.0.0 and the issue is there

How to reproduce (e.g Puppet code you use)

create nginx::resource::server with

locations            => {
    'test'    => {
        proxy    => "http://1.2.3.4/test",
        location => '/test',
    },
},

and also the default location (say having the same proxy for the default location).

then use the locations_defaults to set defaults for all locations. Say

locations_defaults => {
    proxy_set_header  => [
        'Host $host',
        'X-Real-IP $remote_addr',
        'X-Forwarded-Proto https',
        'X-Forwarded-For $proxy_add_x_forwarded_for',
    ],
    proxy_hide_header => [
        'Etag',
        'Accept-encoding',
    ],
},

What are you seeing

I see that the extra defined locations get the default but the default location doesn't. For that I need to repeat the attributes proxy_hide_header and proxy_set_header outside the locations_defaults

What behaviour did you expect instead

If I set the default for locations, it should be applied to all, also to the default location.

Output log

None.

Any additional information you'd like to impart

Another possibility is to document the quirk to say "yes, if you want to affect the default location, you need to write the attributes twice".

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