Search code examples
node.jsnginxdjango-rest-frameworkusersession

Scaling inquiry for User tokens on NginX, Node(angular), Django Rest Framework environment


For our application we are using AngularJS for frontend making API calls to Django backend. We are projecting to have NginX Webserver in front of Node. Currently we are using Django Rest Framework JWT Authentication to create tokens for users. My understanding is Django Rest, JWT authentication creates a token based on the machine it is running on. I am afraid that this solution might not scale because these tokens are based on machines and once we add more servers tokens created in one machine will be invalid on a different one.

I'd appreciate scaling solution suggestion for user token/session on NginX + NodeJS + Django platform.


Solution

  • nginx sticky sessions should resolve this issue.