[Flask] Flask-Security =?utf-8?Q?can=E2=80=99t_?=work with Gunicorn with multiple workers

王帅 stamaimer at gmail.com
Tue Jan 10 01:11:57 EST 2017


Hello, everyone.

I’m writing a website with Flask. I use Flask-Security to do authentication and use Nginx + Gunicorn to deploy it.

And I find a problem that Flask-Security can’t work with Gunicorn with multiple workers.

If the worker number is one, I can login normally. If the worker number of Gunicorn is greater than one or there is more than one Gunicorn servers behind Nginx, There are three situations will happen:

1. It will login normally;
2. It will redirect to login page again;
3. It will redirect to the page protected by Flask-Security with unlogined status.

After I expose Gunicorn server to public, It remains.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/flask/attachments/20170110/3685b957/attachment.html>


More information about the Flask mailing list