[fpc-pascal] Is Path_Info available in FastCGI working as proxy?

Michael Van Canneyt michael at freepascal.org
Fri Jan 30 15:07:56 CET 2015



On Fri, 30 Jan 2015, silvioprog wrote:

> On Thu, Jan 29, 2015 at 7:28 PM, silvioprog <silvioprog at gmail.com> wrote:
>       On Thu, Jan 29, 2015 at 6:58 PM, Michael Van Canneyt <michael at freepascal.org> wrote:
>             On Thu, 29 Jan 2015, silvioprog wrote:
>                   Hello,
>
>                   I've the same problem in Apache and nginx: TRequest.PathInfo always returns an empty string.
>
>                   In Apache, I'm using the the mod_proxy_fcgi module already distributed in Apache 24. In nginx, I'm
>                   using this configuration:
>
>                   location /dev/duallsms {
>                   fastcgi_pass  localhost:8080;
>                   ... other configurations ...
>                   fastcgi_param PATH_INFO $fastcgi_path_info; # from nginx docs
>                   }
>
>                   First I've tested it on Windows, but I've noticed that it fail in Linux too. So I ask: is
>                   PATH_INFO available in FastCGI (working as proxy)? If not, what I use instead it?!
> 
>
>             PATH_INFO is not always available, you need to configure that in apache and/or nginx.
> 
> 
> Thanks for the information.
>  
>       See http://httpd.apache.org/docs/trunk/mod/mod_proxy_fcgi.html
>
>       The FPC fcl-web components by themselves do not try to reconstruct PATH_INFO.
>       You can try determining it from SCRIPT_URI  or SCRIPT_NAME.
> 
> 
> Hm... what do you think about to read it from the REQUEST_URI param? If it is good, you need to do a small change in FCL (if
> relevant hehe). The patch in attached allows to use the implementation below:

No, that will not happen. This is guesswork. 
Whether this will work, will very much depend on the setup.

If you need this, then you should implement the logic for handling REQUEST_URI yourself.

But I am prepared to provide a hook that allows you to determine PATH_INFO yourself 
if the server did not pass it on, since PATH_INFO is needed to determine the module 
that must handle the request.

Michael.


More information about the fpc-pascal mailing list