Hi everyone!
-- i' ve got an unusual question, that is probably not very specific to django. We have a large multi-tenant django app, and we want to split all traffic between two tenants (tenant 1 and tenant 2, for now). This tenant will be connected to different databases. Our django app is 100% API, with token authentication. Every request has auth_token parameter (as GET or POST parameter). The token looks like: tenant1.xxxx, tenant-2.yyyy, tenant-3.xxx.
So, we want to route all traffic with tokens tenant1.xxx to app1 and tokens tenant2.yyyy to app2. to do this, we need to setup something like "proxy router" in front of out existing django app. We already using nginx, and we can route to different backends only if token is GET parameter. There is no way to route based on POST params, as far as I know.
We are discussing several alternatives:
1) Add LUA module to nginx (this module can read POST body data) and perform routing here
2) Write another app (for example, based on Tornado or python3 asyncio) that will be reading POST and GET params and route traffic to appropriate django app. (or another languages? NodeJS (oh, no :) )? Go lang?)
What is the best option here for us? Or some completely different approach?
Thank you!
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/dad35089-0e36-4819-99e9-7ee7d269f458%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment