-
-
Notifications
You must be signed in to change notification settings - Fork 883
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
How to use nginx::resource::vhost:add_header ? #899
Comments
It's a hash:
HTH. Even though the module is encouraging using hiera for data, there are a lot of improvements that could be made in terms of docs. |
thanks for your help i try but always this error : nginx::nginx_vhosts: Error 400 on SERVER: Invalid parameter X-Frame-Options on Nginx::Resource::Vhost working in my site file (.pp) with : |
Can you wrap your yaml in a code block?
and in the generated config for foo.example.com:
|
@leponot: does this help? |
i try Monday when i m back to work |
One issue here as there's no way to implement the always flag... one easy workaround might be to add the always flag in any cases in the vhost template... |
@Zophar78 Which headers are you talking about re: always flag? |
Forget the ssl topic... let's focus on the add_header directive:
So for some reasons i want my header to be added regardless of the response code i need to add the always flag like this: And the current module implementation (Look at the template) doesn't allow it. |
@Zophar78: Yes, it doesn't look like that's possible in the current implementation. That's a separate issue, though, as the OP doesn't have seemed to have had a need for that. I believe it should be possible to do that using the config append / prepend or raw append / prepend directives. Feel free to open a separate issue requesting that an optional 'always' flag be added as a feature (or a pull request implementing the feature and tests for it). I'm not sure how it would be implemented without breaking the current key => value pattern... maybe if the hash value is an string, use the current pattern, and if it's an array, with the second element as a boolean, toggle the 'always' flag. |
Hello i have found my problem, i have some tabulation on my config file... after remove it, no more problem thanks for your help |
Affected Puppet, Ruby, OS and module versions/distributions
Hi
sorry i'm a beginer with hiera,
how i can configure nginx::resource::vhost:add_header:
i want to add secure header but i have always this error : is not a hash
from my srv-reverse-01.xxxx.xx.yaml
nginx::nginx_vhosts:
'xxx.xxxx.xx':
proxy: 'xxx.xxxx.xx'
ssl: true
ssl_cert: /etc/pki/tls/certs/xxx.xxxx.xx.crt
ssl_key: /etc/pki/tls/private/xxx.xxxx.xx.key
rewrite_to_https: true
add_header: ??
for this value for example :
add_header X-Frame-Options SAMEORIGIN
templates/vhost/vhost_header.erb
<% if @add_header -%>
<%- @add_header.keys.sort.each do |key| -%>
add_header '<%= key %>' '<%= @add_header[key] %>';
<%- end -%>
<% end -%>
many thanks
regards
The text was updated successfully, but these errors were encountered: