migrate fastcgi_split_path_info to uwsgi
A. Schulze
sca at andreasschulze.de
Sun Dec 23 13:21:31 UTC 2018
cross-posting to horde & nginx lists...
Hello,
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
PATH_INFO /APP/ACTION[?OPTIONS]
hope, this is correct so far...
to verify my setup I configured
location /horde/services/ajax.php {
fastcgi_split_path_info ^(/horde/services/ajax\.php)(.+)$;
return 200 "REQUEST_URI: $request_uri, SCRIPT_FILENAME: $fastcgi_script_name, PATH_INFO: $fastcgi_path_info ARGS: $args\n";
}
$ curl 'https://example.org/horde/services/ajax.php/APP/ACTION?OPTION=foobar'
REQUEST_URI: /horde/services/ajax.php/APP/ACTION?OPTION=foobar, SCRIPT_FILENAME: /horde/services/ajax.php, PATH_INFO: /APP/ACTION ARGS: OPTION=foobar
that _looks_ correct to me.
Anyway, horde don't work, I get 404 back:
[pid: 1301|app: -1|req: -1/10] 2001:db8::2 () {58 vars in 1220 bytes} [Sun Dec 23 14:19:22 2018] POST /horde/services/ajax.php/imp/dynamicInit => generated 9 bytes in 0 msecs (HTTP/2.0 404) 2 headers in 71 bytes (0 switches on core 0)
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.
Andreas
More information about the nginx
mailing list