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

Add a couple of parameters to fastcgi_params. #20

Closed
wants to merge 2 commits into from
Closed

Add a couple of parameters to fastcgi_params. #20

wants to merge 2 commits into from

Conversation

borfast
Copy link

@borfast borfast commented Jan 8, 2012

A couple of parameters are missing from fastcgi_params.

@perusio
Copy link
Owner

perusio commented Jan 9, 2012

Olá Raul,

There's no $server_https variable AFAICT.

Reloading nginx configuration: nginx: [emerg] unknown "server_https" variable
nginx: configuration file /etc/nginx/nginx.conf test failed

this in 1.1.12.

There is a variable $https_if_not_empty that was introduced in 1.1.11. See the following commits for reference.

http://trac.nginx.org/nginx/changeset/4380/nginx
http://trac.nginx.org/nginx/changeset/4334/nginx
http://trac.nginx.org/nginx/changeset/4333/nginx

I've added this variable to the config. It will work if using Nginx version greater or equal to 1.1.11. If using a prior version then there's a fallback using the map directive.

Thanks for pushing this. It was high time to be included.

@perusio perusio closed this Jan 9, 2012
@perusio
Copy link
Owner

perusio commented Jan 9, 2012

Ah yes, the $request_filename variable. I have to check if it doesn't introduce any issues with FCGI when using an
alias. I'll check it soon. If not then I'll add it, replacing the concatenation of $document root and $fastcgi_script_name.

@borfast
Copy link
Author

borfast commented Jan 10, 2012

I am using nginx 1.1.11 and it doesn't complain about the $server_https variable. Perhaps your nginx.conf is missing something that got updated recently. Mine has it like this:

map $scheme $server_https {
    default off;
    https on;
}

See if that helps.

@borfast
Copy link
Author

borfast commented Jan 10, 2012

Nevermind, I hadn't seen your commit before replying.
You basically added the same thing but with a different name. :)

Thanks!

@perusio
Copy link
Owner

perusio commented Jan 10, 2012

You don't need that if you're using 1.1.11. There's already a $https_if_not_empty variable provided. Check the SVN commits on the Nginx repo above.

@borfast
Copy link
Author

borfast commented Jan 10, 2012

The funny thing is, I don't have a $https_if_not_empty variable but I do have a $server_https, as I described above. That's why I thought it was the default name. But from a couple of google searches, I'm under the impression that this is something unique to the packages in the official Ubuntu PPA. They also removed aio support (stating that it caused too much trouble), which makes me wonder what else is changed. I'm starting to think that maybe I prefer to go with building nginx from source myself instead...

@perusio
Copy link
Owner

perusio commented Jan 10, 2012

But that came with your config. It's not anywhere on the official sources AFAICT. You can test for $https_if_not_empty. On the SSL host do:

location = /https-var-test {
    return 200 "https_if_not_empty: $https_if_not_empty\n";
}

if it exists curl -is https://domain.com/https-var-test it will print 'on'.

@borfast
Copy link
Author

borfast commented Jan 10, 2012

Exactly, it came with my config, hence my mix up.
But I don't have the $https_if_not_empty variable anywhere on my config files and testing it with that snippet just results in the typical error:

$ nginx -t
nginx: [emerg] unknown "https_if_not_empty" variable
nginx: configuration file /etc/nginx/nginx.conf test failed

I'll have to check what other differences there are between the PPA and the source.

@perusio
Copy link
Owner

perusio commented Jan 10, 2012

Well Raul my advice is for you to build your own. I did the same. In a critical component like the web server you should be in control as much as possible. Also Nginx has a breakneck development rhythm by buidling your own you're always on the bleeding edge, which is the place to be :)

IIRC there as a snafu with AIO on Linux on 1.1.9 (see here) they released 1.1.10 to fix that. Probably the PPA mantainer didn't bother to update the debian rules file after 1.1.9.

@borfast
Copy link
Author

borfast commented Jan 10, 2012

I agree. I usually don't software from PPAs but since the version in Ubuntu's repositories is old and even the official repositories from nginx.org for both Debian and Ubuntu are still stuck on 1.0.11, I thought I'd give it a try. What I'd like was a simple and semi-automated way of upgrading to new versions (what I'm doing is not a mission critical thing) but it's not that much work to do it by hand, I guess.

@perusio
Copy link
Owner

perusio commented Jan 10, 2012

Well the obvious plug: use mine ;) I maintain up to date versions. This is really bleeding edge. Usually I add patches posted to the nginx-devel list. It's built for debian unstable but with apt pinning you can use with stable or Ubuntu. I don't know how the dependencies in debian terms map to Ubuntu releases. You have to try and see how it goes.

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

Successfully merging this pull request may close these issues.

2 participants