Dnia wtorek, 20 grudnia 2011 19:47:59 Roberto De Ioris pisze:
> > 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 {
> [...]
> }
> 
> 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 :)

At first I didn't understand why You need to do all the above, but then I 
realized that vassal doesn't get HTTP requests, it gets uwsgi protocol  
requests, so it's maybe not as simple as putting:
redirect = / /my/page/index
rewrite = ^.+$ %{PATH_INFO}.php 
into vassal config.
Adding any advanced login into configuration may be more problematic than 
parsing requests as You would need a config syntax that is
a) powerfull enough to handle everything user may want to setup (look how easy 
and elegant it is in nginx/lighttpd vs apache)
b) compatible with current config handling in multiple formats (ini/yaml/xml), 
it's going to be hard or even impossible to have multiple nested if then else 
statements in ini file.
so maybe moving this to some loadable module in luajit or anything as fast 
would be the best way. It's nothing that I need to have right now as all apps 
I'm going to run using uWSGI are my company internal  projects, so I can just 
tell dev guys that they need to handle that in apps. Most of the apps are 
going to be ruby/django without the need to setup any external 
redirect/rewrite rules so I will probably don't event notice the lack of this 
feature, but still this is commonly used and I will notice the lack of it in 
the future. Marketing guys can knock on my doors any minute and say that they 
need to do quick redirect to some fancy url because they have deal with a 
client and they forgot to tell anyone that it needs to be done.

> The "--static-index" would be required in your case.

I see that static-index was added to 1.0 so I've added:
static-index = index.html
to my vassal config and it works as expected, but I'm not sure what value does 
this option expects as index=1 also works and show /index.html if I request / 
path.

Łukasz Mierzwa
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to