migrate fastcgi_split_path_info to uwsgi

Francis Daly francis at daoine.org
Thu Dec 27 17:17:10 UTC 2018

On Sun, Dec 23, 2018 at 02:21:31PM +0100, A. Schulze wrote:
> cross-posting to horde & nginx lists...

Hi there,

> I plan to migrate a PHP Application (horde) from php-fpm to uwsgi.
> nginx talk "fastcgi protocol" to php-fpm now and have to talk "uwsgi protocol" to uwsgi later.
> Horde uses partially arguments as URL elements.
> example comment in https://github.com/horde/base/blob/master/services/ajax.php
> the corresponding nginx config I currently use:
>         location ~ /horde/services/ajax.php/ {
>             fastcgi_split_path_info     ^(.+\.php)(/.+)$;
>             fastcgi_pass                unix:/var/run/php.sock;
>             include                     /etc/nginx/fastcgi.conf;
>         }
> the example URL used in ajax.php: http://example.com/horde/services/ajax.php/APP/ACTION[?OPTIONS]
>     without fastcgi_split_path_info:
> 	SCRIPT_FILENAME  /horde/services/ajax.php/APP/ACTION
> 	PATH_INFO        is empty?
>     with fastcgi_split_path_info:
> 	SCRIPT_FILENAME /horde/services/ajax.php

The nginx directive fastcgi_split_path_info just sets some
internal-to-nginx variables.

To send things like SCRIPT_FILENAME and PATH_INFO to the upstream fastcgi
service, you will have some fastcgi_param directives that use those
variables -- in this case, presumably they are in the "include" file.

> Unfortunately there is no "uwsgi_split_path_info" in nginx.
> That means to me
>  - it's simply not implemented
>  - the problem is solved in a other way.
> I appreciate any hint on how to solve the "split" or at least debug what's going on.

You can continue to use fastcgi_split_path_info to set some variables.

For uwsgi, you will need some uwsgi_param directives.

You may want to edit whatever default "include" file you use, or perhaps
write the directives directly.

You will want to know what parameter names your upstream uwsgi server
actually uses, and make sure to set those to the values you need.

Good luck with it,

Francis Daly        francis at daoine.org

More information about the nginx mailing list