0

Everything is working on my site, except when I'm trying to log in with twitter through python-social-auth. It worked well on my local development server, but when I went into production, after the twitter login, it sends the response to http://127.0.0.1:8001/complete/twitter.....

I am using gunicorn+nginx without too much knowledge about it, except that i've used it for other projects without problems. Although, I have binded gunicorn --bind 127.0.0.1:8001. Is that the problem? I tried using --bind mydomain.com:8001 but that gives me a 502 Bad Gateway response.

Martol1ni
  • 4,684
  • 2
  • 29
  • 39
  • Impossible to say without seeing the code. And what is the callback url set in the Twitter app? – Bibhas Debnath Mar 02 '14 at 17:26
  • check your twitter oauth app redirect url – almalki Mar 02 '14 at 18:39
  • 3
    Sounds like your application ran by gunicorn doesn't know that's behind a proxy and the real URL for it, try defining `proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;` and `proxy_set_header Host $http_host;` in your nginx conf. – omab Mar 04 '14 at 23:27

0 Answers0