[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nginx
Subject:    Re: PATH_INFO
From:       "Dave Dash" <dd () davedash ! com>
Date:       2008-01-23 17:56:16
Message-ID: 694fa1450801230956y647bc30cvc76431ad71a3e3bf () mail ! gmail ! com
[Download RAW message or body]

Yeah, I'm passing everything to FastCGI.

I'm using something similar to this:

location \.php(/|$) {
>
> set $script_name $uri;
> set $path_info "";
>
> if ($uri ~ ^(.+\.php)(/.+)) {
> set $script_name $1;
> set $path_info $2;
> }
>
> fastcgi_pass ...
>
> fastcgi_param SCRIPT_FILENAME /path*/to/*$script_name;
> fastcgi_param PATH_INFO $path_info;
> }
>
>

but really $path_info should be url_decoded before being set as a
fastcgi_param.  Since the CGI spec says:

The extra path information, as given by the client. In other words, scripts
> can be accessed by their virtual pathname, followed by extra information at
> the end of this path. The extra information is sent as PATH_INFO. This
> information should be decoded by the server if it comes from a URL before it
> is passed to the CGI script.
>
>
But is there a way that I can just do

fstcgi_param PATH_INFO urldecode($path_info); ?


-- 



On Jan 23, 2008 3:55 AM, Aníbal Rojas <anibalrojas@gmail.com> wrote:

> Dave,
>
>    There is no support for CGI in Nginx. You have to FastCGI or HTTP
> (proxy)
>
> --
> Aníbal Rojas
> http://hasmanydevelopers.com
> http://rubycorner.com
> http://anibal.rojas.com
>
> On Jan 24, 2008 2:40 AM, Dave Dash <dd@davedash.com> wrote:
> > PATH_INFO is supposed to be decoded by the server and then passed to
> > the CGI application.
> >
> > How can I do that from nginx.  My PATH_INFO never gets decoded and it
> > throws off my CGI scripts.
> >
> > best,
> >
> > dd
> >
>
>


-- 
Dave Dash
612.670.0621
Discover your favorite restaurant: reviewsby.us
gtalk: dave.dash

[Attachment #3 (text/html)]

Yeah, I&#39;m passing everything to FastCGI.<br><br>I&#39;m using something similar \
to this:<br><br><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: \
0pt 0pt 0pt 0.8ex; padding-left: 1ex; font-family: courier new,monospace;" \
class="gmail_quote">  location \.php(/|$) {<br><br>       set  $script_name  \
$uri;<br>       set  $path_info    &quot;&quot;;<br><br>       if ($uri ~ \
^(.+\.php)(/.+)) {<br>           set  $script_name  $1;<br>           set  $path_info \
$2; <br>       }<br><br>       fastcgi_pass   ...<br><br>       fastcgi_param  \
SCRIPT_FILENAME  /path<i>/to/</i>$script_name;<br>       fastcgi_param  PATH_INFO     \
$path_info;<br>   }<br><br></blockquote><pre><br><br>but really $path_info should be \
url_decoded before being set as a fastcgi_param.  Since the CGI spec says: \
<br></pre><blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt \
0pt 0pt 0.8ex; padding-left: 1ex;" class="gmail_quote"><p>   The extra path \
information, as given by the client. In other  words, scripts can be accessed by \
their virtual pathname, followed  by extra information at the end of this path. The \
extra  information is sent as PATH_INFO. This information should be
    decoded by the server if it comes from a URL before it is passed
    to the CGI script.</p><p>

</p> <code></code></blockquote><pre><br>But is there a way that I can just do \
<br><br>fstcgi_param PATH_INFO urldecode($path_info); ?<br><br><br>-- \
</pre><br><br><div class="gmail_quote">On Jan 23, 2008 3:55 AM, Aníbal Rojas &lt; <a \
href="mailto:anibalrojas@gmail.com">anibalrojas@gmail.com</a>&gt; \
wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, \
204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Dave,<br><br>  &nbsp; \
&nbsp;There is no support for CGI in Nginx. You have to FastCGI or HTTP \
(proxy)<br><font color="#888888"><br>--<br>Aníbal Rojas<br><a \
href="http://hasmanydevelopers.com" \
target="_blank">http://hasmanydevelopers.com</a><br><a href="http://rubycorner.com" \
target="_blank"> http://rubycorner.com</a><br><a href="http://anibal.rojas.com" \
target="_blank">http://anibal.rojas.com</a><br></font><div><div></div><div \
class="Wj3C7c"><br>On Jan 24, 2008 2:40 AM, Dave Dash &lt;<a \
href="mailto:dd@davedash.com"> dd@davedash.com</a>&gt; wrote:<br>&gt; PATH_INFO is \
supposed to be decoded by the server and then passed to<br>&gt; the CGI \
application.<br>&gt;<br>&gt; How can I do that from nginx. &nbsp;My PATH_INFO never \
gets decoded and it <br>&gt; throws off my CGI scripts.<br>&gt;<br>&gt; \
best,<br>&gt;<br>&gt; dd<br>&gt;<br><br></div></div></blockquote></div><br><br \
clear="all"><br>-- <br>Dave Dash<br>612.670.0621<br>Discover your favorite \
restaurant: <a href="http://reviewsby.us"> reviewsby.us</a><br>gtalk: dave.dash



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic