Hi Roberto,

On Thu, Jan 16, 2014 at 12:58 AM, Roberto De Ioris <[email protected]> wrote:
[snip]

>
> mount = /verify=verify.py
>
> and
>
> route = ^/verify setapp:/verify
>

Thank you for correcting the syntax.

I was hoping to use mount+route (or whatever the best
alternative/equivalent is) to define a finite number of url endpoints, with
a "catch-all" handler function for everything else.

When I use the two lines as shown above, requests to /verify do get passed
to the verify.py script.

But when I added a second pair of lines like this:

mount = /login=login.py
route = ^/login setapp:/login

Making a browser request to /login gave me a 500 error:

2014/01/18 18:18:29 [error] 2534#0: *10 connect() failed (111: Connection
refused) while connecting to upstream, client: ::1, server: , request: "GET
/login HTTP/1.1", upstream: "uwsgi://[::1]:9090", host: "localhost"
2014/01/18 18:18:29 [error] 2534#0: *10 upstream prematurely closed
connection while reading response header from upstream, client: ::1,
server: , request: "GET /login HTTP/1.1", upstream: "uwsgi://127.0.0.1:9090",
host: "localhost"

Is mount+route only allowed once?

I should mention that my use case is somewhat unorthodox: I'm running uwsgi
behind nginx, but I'm *not* using django, flask, etc., or any other python
web framework.

So can I use the ini file to define url endpoints like this, or should I do
my own routing internally in python instead, using the env data passed to
the handler function?

BTW, is the github document link --
https://github.com/unbit/uwsgi-docs/blob/master/index.rst -- correct? I
followed it from https://uwsgi-docs.readthedocs.org/en/latest/ but it seems
out-of-date.

I'd be happy to contribute example documentation for this use case via a
pull request (once i have figured it out, of course), if you think it would
be helpful.
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi

Reply via email to