>
>
> Great, the only thing I'm missing from uWSGI is possibility to:
> * write redirect/rewrite rules in vassal config
i need this too for my company, but i am quite unsure un how to realize that.
My first idea was having a "router" request plugin, that you can map to a
bunch of code
in one of the supported languages, used as a "filter" for the request:
#in perl
sub my_uwsgi_router {
my ($modifier1, $modifier2, %env) = @_;
# force it as a php request
if ($env{'PATH_INFO'} =~ /\.php$/) {
return (14, $modifier2, %env);
}
# pass to cgi handler
if ($env{'PATH_INFO'} =~ /^\/cgi-bin\//) {
return (9, $modifier2, %env);
}
# rewrite QUERY_STRING
if ($env{'PATH_INFO'} eq '/foo') {
$env{'QUERY_STRING'} = 'a=1';
return ($modifier1, $modifier2, %env);
}
}
the "bad" thing is that for a simple "rewrite rule" you need to manage
PATH_INFO,REQUEST_URI,QUERY_STRING and SCRIPT_NAME (at least) but maybe
this is not a real problem but a feature :)
> * support for index files in --check-static - so if someone requests
> /somedir/
> (or even / if I have '--check-static /') uWSGI would check for index.html
> (or
> any other filename that is configured as index file
this will be added for sure after 1.0
>
> Normally above features would be done by nginx, but this is impossible in
> nginx->fastrouter->nodes setup (or I am missing something?)
it depends on your kind of setup, if your docroots have not a fixed path
you have no way to automate this in nginx without having a config for each
virtualhost.
>
> BTW I did a very very quick test of cgi plugin with php and it works fine,
> but
> I couldn't make it use /index.php for / requests, I had cgi-index =
> index.php but all I got was 403. I didn't had time to look into it so if
> it
>
you need to set it in nginx too, otherwise nginx will returns a 403 before
passing the request to uWSGI. You can use cgi-index alone only with the
uwsgi http router. Other webservers need a setup for that.
In nginx you will end with:
location / {
root <path_of_php_dir>;
index index.php;
}
location ~ .php$ {
include uwsgi_params;
uwsgi_modifier1 9;
uwsgi_pass <socket>;
}
But i suppose, in your specific setup, each user can choose where to put
his files, so configuring it in nginx would be almost impossibile. The
"--static-index" would be required in your case.
--
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi