> Hi,
>
> I was reading about fastrouter, and curious, whether it's possible to
> route
> to subdirectories instead of domains.
>
> E.g. example.com/projects/project1/ will route to one project, and
> /projects/project2/ will route to another.
>
> I have hundreds of projects, and have some reasons which do not allow me
> exposing it through subdomains, only through subdirectories.
>
> Thanks!
> _______________________________________________
> uWSGI mailing list
> [email protected]
> http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi
>

Not "on the fly".

If you have nginx on front you can set the UWSGI_FASTROUTER_KEY variable
to a custom value (something like example.com/foo) and this will be used
as the mapping key instead of HTTP_HOST:

location ~ ^/projects/(?<myapp>[a-zA-Z0-9]+) {
    include uwsgi_params;
    uwsgi_pass 127.0.0.1:3031;
    uwsgi_param UWSGI_FASTROUTER_KEY $http_host/$myapp;
}

now you "subscribe" (or store in the cache) as the example.com/foo key

-- 
Roberto De Ioris
http://unbit.it
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to