[fpc-pascal] Re: Nginx, FastCGI and /module/action vs ?module=moduleaction=action

2012-07-23 Thread leledumbo
Seems like the old IncludeHTTPPathDelimiter bug strikes back (AFAIR it's been
closed when I said Marco's patch works), I need to change:

procedure RegisterFileLocation(const ALocation,ADirectory: String);
begin
  ...
  if (ADirectory='') then
   
Locations.Values[IncludeTrailingPathDelimiter(ALocation)]:=ExtractFilePath(ParamStr(0))
  else  
   
Locations.Values[IncludeTrailingPathDelimiter(ALocation)]:=IncludeTrailingPathDelimiter(ADirectory);
  ...
end;

to

procedure RegisterFileLocation(const ALocation,ADirectory: String);
begin
  ...
  if (ADirectory='') then
   
Locations.Values[IncludeHTTPPathDelimiter(ALocation)]:=ExtractFilePath(ParamStr(0))
  else  
   
Locations.Values[IncludeHTTPPathDelimiter(ALocation)]:=IncludeTrailingPathDelimiter(ADirectory);
  ...
end;

Furthermore, nginx supports multiple servers (so that we could have:
http://localhost/what/ever/it/is/www.realsite.com) which would cause problem
with MapFileName code because BaseURL property takes the first slash after
http:// up to the last slash (in case of:
http://localhost/what/ever/it/is/www.realsite.com/css/mycss.css, BaseURL =
/what/ever/it/is/www.realsite.com/css/). I'll report this.



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Nginx-FastCGI-and-module-action-vs-module-module-action-action-tp5710411p5710426.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Nginx, FastCGI and /module/action vs ?module=moduleaction=action

2012-07-22 Thread leledumbo
 Please report any bugs you find. 
I know of only 1 bug that is connected to reliability.

I would, but the error is intermittent and it's difficult to create a test
program that always generates the bug.

 Module/action syntax depends on how the PATHINFO variable is passed to the
 CGI/FastCGI script

OK, I'll try dumping it. Anyway, does cgidebug define could help?



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Nginx-FastCGI-and-module-action-vs-module-module-action-action-tp5710411p5710415.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Nginx, FastCGI and /module/action vs ?module=moduleaction=action

2012-07-22 Thread leledumbo
It's indeed nginx fastcgi configuration issue, I've managed to make it work
somehow by reading its documentation. Thanks :)



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Nginx-FastCGI-and-module-action-vs-module-module-action-action-tp5710411p5710416.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Re: Nginx, FastCGI and /module/action vs ?module=moduleaction=action

2012-07-22 Thread Luiz Americo Pereira Camara

Em 22/7/2012 18:49, leledumbo escreveu:

It's indeed nginx fastcgi configuration issue, I've managed to make it work
somehow by reading its documentation. Thanks :)




Can you post your config here so we can also learn how to configure nginx?


Luiz


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Re: Nginx, FastCGI and /module/action vs ?module=moduleaction=action

2012-07-22 Thread leledumbo
Basically I just have to add this:
http://wiki.nginx.org/HttpFastcgiModule#fastcgi_split_path_info

location / {
fastcgi_split_path_info ^((?U).+www.tkd1depok.org)(/?.+)$;
 
fastcgi_param  PATH_INFO  $fastcgi_path_info;
fastcgi_param  PATH_TRANSLATED$document_root$fastcgi_path_info;
fastcgi_param  SCRIPT_FILENAME   
$document_root$fastcgi_script_name;
...
# previous configuration
}

and that's the cause of empty PATH_INFO. I'm still having an issue with
fpwebfile can't map uri to the correct file (it returns empty string), but I
guess it shouldn't be difficult to solve.



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Nginx-FastCGI-and-module-action-vs-module-module-action-action-tp5710411p5710418.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal