Flask redirect(url_for) error with gunricorn + nginx
问题 I am having a problem with the redirect(url_for) function in my flask app. Any redirect(url_for("index")) line redirects the application from domain.com/app to ip-addr/app , where the ip-addr is my own client machines ip, not the server's. This has gotten me very confused, and I don't know where exactly the issue occurs, as it only happens on the server and not on any local testing. Details: I am using the reverse proxy setup found here http://flask.pocoo.org/snippets/35/. My nginx config is