Problem with fastcgi_split_path_info on ubuntu precise
B.R.
reallfqq-nginx at yahoo.fr
Sun May 5 00:13:12 UTC 2013
It seems that PATH_INFO is sensitive to points being used in URI...
Check the PHP doc about
$_SERVER<http://www.php.net/manual/en/reserved.variables.server.php>:
a very interesting example is being provided there.
Ubuntu is much likely not the problem.
Since you are a 'good sysadmin', you also tried to relate trouble to some
recent update of packages if any. :o)
If nothing changed in your setup or in your configuration, then it comes
from bad/unreliable usage of unknown resources.
Hope that I helped,
---
*B. R.*
On Sat, May 4, 2013 at 7:41 PM, zakaria <nginx-forum at nginx.us> wrote:
> Francis Daly Wrote:
> -------------------------------------------------------
> > On Fri, May 03, 2013 at 09:44:14PM -0400, zakaria wrote:
>
> > Hi there,
>
> > What output do you expect?
>
> > And if it not obvious: how does that differ from this output?
>
> > I *think* you're reporting that PATH_INFO is unexpectedly empty
> > in $_SERVER, in which case adding "fastcgi_param TEST_PATH_INFO
> > $fastcgi_path_info;" and retrying might give a hint as to where the
> > problem is.
>
> > f
> > --
> > Francis Daly francis at daoine.orgYes, that's what I mean.
>
> I'm sorry for being cryptic but this problem has me puzzled for two days.
>
> Let me tell the long story.
> I'm trying to setup a web server using nginx in ubuntu 12.04.2 (precise)
> Like any good sysadmin, I use bash script to setup everything.
> So I could replay it anytime.
>
> So on the friday I rerun the script (to enhanced it) and it didn't work
> like
> it used to.
> I swear, I got nginx working perfectly before with PATH_INFO and all.
>
> To answer your question. The PATH_INFO should output to '/foo/bar.php'
>
> Per your request here's my modified config
> ------------------------------------------------------------
> location ~ [^/]\.php(/|$) {
> fastcgi_split_path_info ^(.+?\.php)(/.*)$;
> fastcgi_param PATH_INFO $fastcgi_path_info;
> fastcgi_param TEST_PATH_INFO $fastcgi_path_info;
> try_files $fastcgi_script_name =404;
>
> fastcgi_pass unix:/var/run/php5-fpm.sock;
> fastcgi_index index.php;
> include fastcgi_params;
> }
> ------------------------------------------------------------
>
> And the result with cgi.fix_pathinfo = 1 (the default)
> ------------------------------------------------------------
> array (
> 'USER' => 'www-data',
> 'HOME' => '/var/www',
> 'FCGI_ROLE' => 'RESPONDER',
> 'PATH_INFO' => '',
> 'TEST_PATH_INFO' => '',
> 'QUERY_STRING' => '',
> 'REQUEST_METHOD' => 'GET',
> 'CONTENT_TYPE' => '',
> 'CONTENT_LENGTH' => '',
> 'SCRIPT_FILENAME' => '/var/www/test.php',
> 'SCRIPT_NAME' => '/test.php',
> 'REQUEST_URI' => '/test.php/foo/bar.php',
> 'DOCUMENT_URI' => '/test.php',
> 'DOCUMENT_ROOT' => '/var/www',
> 'SERVER_PROTOCOL' => 'HTTP/1.1',
> 'GATEWAY_INTERFACE' => 'CGI/1.1',
> 'SERVER_SOFTWARE' => 'nginx/1.4.0',
> 'REMOTE_ADDR' => '192.168.56.1',
> 'REMOTE_PORT' => '33683',
> 'SERVER_ADDR' => '192.168.56.3',
> 'SERVER_PORT' => '80',
> 'SERVER_NAME' => '',
> 'HTTPS' => '',
> 'REDIRECT_STATUS' => '200',
> 'HTTP_HOST' => 'lemp.test',
> 'HTTP_USER_AGENT' => 'Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:20.0)
> Gecko/20100101 Firefox/20.0',
> 'HTTP_ACCEPT' =>
> 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
> 'HTTP_ACCEPT_LANGUAGE' => 'en-US,en;q=0.5',
> 'HTTP_ACCEPT_ENCODING' => 'gzip, deflate',
> 'HTTP_CONNECTION' => 'keep-alive',
> 'HTTP_CACHE_CONTROL' => 'max-age=0',
> 'PHP_SELF' => '/test.php',
> 'REQUEST_TIME' => 1367710298,
> )
> ------------------------------------------------------------
>
> So here's my request to you all:
> 1. Is my config correct? I'm sure it is.
> 2. Could you try it on your system and
> tell me whether the output differ from mine?
> 3. Is there something wrong on the latest ubuntu precise?
> Or is it just my imagination that I have it working before? :)
>
> Thanks,
>
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?2,238825,238849#msg-238849
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130504/e11e74b5/attachment-0001.html>
More information about the nginx
mailing list