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

Unable to control fastcgi_params from module? #1064

Closed
ghost opened this issue Apr 6, 2017 · 3 comments
Closed

Unable to control fastcgi_params from module? #1064

ghost opened this issue Apr 6, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 6, 2017

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 3.8.5
  • Ruby: 2.3.1p112
  • Distribution: Ubuntu 16.04
  • Module version: puppet-nginx (v0.6.0)

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

What are you seeing

I need to be able to control the contents of the fastcgi_params file. I have included the example file i need the module to output below.
From what i can see though the fastcgi_params file is just a static outputtet file that doesnt have any variables except the FQDN in the top. Is this correct ?

fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_param HTTPS $https; fastcgi_param REDIRECT_STATUS 200; fastcgi_param HTTP_PROXY "";

What behaviour did you expect instead

Some options i could set in Hiera of puppet code to control contents of the fastcgi_params file that i can change references to in other places like location and server blocks.

Output log

Any additional information you'd like to impart

I'm fairly new at this so i might be missing something obvious. I would love to try and create a fix but i don't fully understand the module so icannot at present time propose a PR to fix what i assume is an issue.

I'm using Hiera to setup my site so my puppet file is only this
class { 'nginx': } # options is set in hiera (package_name)

@wyardley
Copy link
Collaborator

Just to explain, fastcgi_params are not parameterizable, however, you can set it to a different filename, and, if you also push that file from Puppet (from a site manifest, say; there needs to be a File resource defined for it as things work now), you can reference that file.

so

file { '/etc/nginx/fastcgi_params_extra':
  ensure: present,
  source: ....,
}

and

nginx::resource::location { 'foo':
  [....]
  fastcgi_params =>  '/etc/nginx/fastcgi_params_extra'
}

There are some other approaches we could take to make this more customizable (parameterizing the template or letting the user specify the template to use), but so far, that's the only option I know of; it might be possible to force override the file resource entirely with different content; I haven't messed with it too much, but this is the basic idea:
http://stackoverflow.com/questions/30016279/puppet-overriding-file-resource-on-a-module

@wyardley
Copy link
Collaborator

ps - I've proposed something in #1076 which at least makes it a little easier to include a non-default file in certain cases, though it still doesn't allow a ton of customization. We could also look at making it an optional parameter, allowing you to suppress it entirely (you could then just do a raw include or use the deprecated fastcgi_param, as discussed in #682).

@oranenj
Copy link
Contributor

oranenj commented Apr 22, 2017

I think this might be fixed via #1076, so I'll close the issue.

@oranenj oranenj closed this as completed Apr 22, 2017
@alexjfisher alexjfisher changed the title unable to control fastcgi_params from module ? Unable to control fastcgi_params from module? Aug 1, 2017
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

2 participants