Forum: NGINX getting environment variables and request headers

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7cad26094530d9cd86aaf2f47bf972c8?d=identicon&s=25 Anıl Çetin (Guest)
on 2009-03-12 13:56
(Received via mailing list)
Hi, I am trying to get environment variables (any) and http headers, is
there a specific way to get them in config? As an example, I need  (as
apache) %{HTTP:Authorization} , what is the corresponding variable in
nginx for this?
A8108a0961c6087c43cda32c8616dcba?d=identicon&s=25 Maxim Dounin (Guest)
on 2009-03-12 14:36
(Received via mailing list)
Hello!

On Thu, Mar 12, 2009 at 02:46:51PM +0200, Anıl Çetin wrote:

> Hi, I am trying to get environment variables (any) and http headers, is
> there a specific way to get them in config? As an example, I need  (as
> apache) %{HTTP:Authorization} , what is the corresponding variable in
> nginx for this?

http://www.nginx-community.org/NginxHttpCoreModule#Variables

$http_authorization

Maxim Dounin
73ad028341c045f423691da9dae1be53?d=identicon&s=25 张立冰 (Guest)
on 2009-03-12 14:44
(Received via mailing list)
mod_parsed_vars <http://hg.mperillo.ath.cx/nginx/mod_parsed_vars> did
this
job. Other else modify the http access key module. :)
7cad26094530d9cd86aaf2f47bf972c8?d=identicon&s=25 Anıl Çetin (Guest)
on 2009-03-12 16:20
(Received via mailing list)
Thanks for answers. I am confused about apache, I thought that
%{HTTP_USER_AGENT} != %{HTTP:User-Agent} and so on. Also I know that
there is a wiki and read all of them of course :) Just check
http://www.anilcetin.com/convert-apache-htaccess-to-nginx/ I did this
yesterday and now I am trying to make it more stable.

Is'nt it possible to do things like below without mod_parsed_vars?

if($env_something != "1"){
    setenv something=1;
}




??? yazmış:
This topic is locked and can not be replied to.