Skip Menu |

This queue is for tickets about the Catalyst-Runtime CPAN distribution.

Report information
The Basics
Id: 57630
Status: resolved
Priority: 0/
Queue: Catalyst-Runtime

People
Owner: bobtfish [...] bobtfish.net
Requestors: mark [...] orbislumen.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 5.80022
Fixed in: (no value)



Subject: FastCGI Engine, Nginx uri/path problems when run remotely
Hi - who knows with all the variations in documentation about what should be done in Nginx configs, and the changes internally dealing with uri_to... But this happens when running Nginx on a remote server, accessing Catalyst on another server being run via net socket FCGI (using scripts/fastcgi.pl) If Nginx sends SCRIPT_NAME, Catalyst uri_to paths are screwed up -- where the last controller/action bit gets duplicated on the end. If Nginx sends PATH_INFO and no SCRIPT_NAME, then Catalyst makes good uri_to stuff. However, it generates errors in the server logs that FastCGI sends back in stderr: Use of uninitialized value $script_name in regexp compilation at /home/mark/perl5/lib/perl5/Catalyst/Engine/FastCGI.pm line 239 Of course, this or that thing to suck up the errors/warnings, when it's working correctly... But it can also be fixed by adding the following to Catalyst/Engine/FastCGI.pm 237c237 < elsif ( $env->{SERVER_SOFTWARE} =~ /^nginx/ && $env->{SCRIPT_NAME} ) { --- Show quoted text
> elsif ( $env->{SERVER_SOFTWARE} =~ /^nginx/ ) {
Well, you'd prolly want to put the simpler test first. I have no idea how this effects other things you may have in mind - but this is for you, from my insular little world, in case it might be good for you to know.
Can you show me the two example sets of nginx configurations you're using for each case, and the environment you're seeing in $c->engine->env? This will help me replicate the issue and write some failing tests so that we can fix this issue properly. Thanks in advance.
Subject: Re: [rt.cpan.org #57630] FastCGI Engine, Nginx uri/path problems when run remotely
Date: Mon, 19 Jul 2010 16:51:39 -0700
To: bug-Catalyst-Runtime [...] rt.cpan.org
From: "Mark Rushing" <mark [...] orbislumen.net>
Oh Thomas, if it were a couple months ago, I'd be happy to. As it is, this has passed out of memory, as well as disk files. I had discovered the issue while I was evaluating Catalyst. Quoting "Tomas Doran via RT" <bug-Catalyst-Runtime@rt.cpan.org>: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=57630 > > > Can you show me the two example sets of nginx configurations you're > using for each case, and the environment you're seeing in $c->engine->env? > > This will help me replicate the issue and write some failing tests so > that we can fix this issue properly. > > Thanks in advance. >
I'm 100% certain that this issue is resolved if nginx is configured as per the documentation in Catalyst-Manual
It'd be cool to have catalyst test this. If the SCRIPT_NAME must be '/' then whey not just throw an assertion if it is ever *not* '/'? Isn't there a better way to give feedback when the web server misbehaves? -- Evan Carroll System Lord of the Internets http://www.evancarroll.com
This is fixed by configuring your nginx settings as documented in the manual, at http://search.cpan.org/~hkclark/Catalyst-Manual-5.9002/lib/Catalyst/Manual/Deployment/nginx/FastCGI.pod.