Il giorno 03/mag/2012, alle ore 10:25, Riccardo Magliocchetti ha scritto: > Hello, > > it took a bit to me to understand that route and static-map are complementary > and are the way to go in case of mixed dynamic app + static file serving > environment. Probably because this is the first time i use the internal > routing and serve static files with uwsgi :) > > Anyway this is what i'm using right now: > > route = \.php$ uwsgi:,9,0 > static-map = ^/foo/=%(docroot)/foo/ > static-map = ^/images/=%(docroot)/images/ > > I was wondering if the static map can be expressed as route too, which imho > looks a lot more natural: > > route = \.php$ uwsgi:,9,0 > route = ^/foo static:%(docroot)/foo/ > route = ^/images static:%(docroot)/images/ > > Probably it's just a matter of missing router plugin or am i missing > something? Do you see this as an improvement? > > thanks in advance, > riccardo > _______________________________________________ > uWSGI mailing list > [email protected] > http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
I think you can start from the router_redirect plugin and modify it for calling uwsgi_file_serve(wsgi_req, docroot, docroot_len, requested_file, requested_file_len, is_a_file) where is_a_file is 1 if docroot is not a directory but a file The functions returns -1 if the file cannot be served or zero if all goes well -- Roberto De Ioris http://unbit.it JID: [email protected] _______________________________________________ uWSGI mailing list [email protected] http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
