{ "info": { "author": "Nguy\u1ec5n H\u1ed3ng Qu\u00e2n", "author_email": "ng.hong.quan@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Flask", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3 :: Only", "Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware" ], "description": "==================\nFlask Behind Proxy\n==================\n\n\nProvide a middleware for Flask application, to fix redirection issue when the application runs behind a reverse proxy, like Nginx.\n\nThe redirection issue is that, when your website is HTTPS and a *view* returns a 301/302 reponse, the new URL mistakenly becomes HTTP.\n\nThis resolution requires you to configure Nginx so that it passes a custom header, to inform the scheme (HTTPS) of the original request. To do that, you just need to setup like this in your Nginx virtualhost config:\n\n.. code-block:: nginx\n\n location / {\n include proxy_params;\n proxy_pass http://localhost:8000;\n }\n\nThis is the common setup for Nginx on Debian/Ubuntu. Nginx on other distros may not have *proxy_params* file, you can add configuration like this:\n\n.. code-block:: nginx\n\n location / {\n proxy_pass http://localhost:8000;\n proxy_set_header Host $http_host;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\n proxy_set_header X-Forwarded-Proto $scheme;\n }\n\nCurrently, *Flask Behind Proxy* is only tested with Nginx web server.\n\n\nInstall\n-------\n\n.. code-block:: shell\n\n pip install flask-behind-proxy\n\n\nUsage\n-----\n\n.. code-block:: python\n\n from flask import Flask\n from flask_behind_proxy import FlaskBehindProxy\n\n app = Flask(__name__)\n proxied = FlaskBehindProxy(app)\n\n\nOther implementation\n--------------------\n\nOther implementation is `Flask Reverse Proxy `_. It is based on a header name that is not \"standard\" (in my terms, it is the name chosen by Debian/Ubuntu maintainer). I chose to make a new software myself, instead of contributing to *Flask Reverse Proxy*, because **wilbertom** seems not to be very reactive, and I want to have a clean code, without Python 2 backward compatibility, and newer tool (like *pyproject.toml* file).\n", "description_content_type": "text/x-rst", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/hongquan/flask-behind-proxy/", "keywords": "", "license": "MIT", "maintainer": "Nguy\u1ec5n H\u1ed3ng Qu\u00e2n", "maintainer_email": "ng.hong.quan@gmail.com", "name": "flask-behind-proxy", "package_url": "https://pypi.org/project/flask-behind-proxy/", "platform": "", "project_url": "https://pypi.org/project/flask-behind-proxy/", "project_urls": { "Homepage": "https://bitbucket.org/hongquan/flask-behind-proxy/", "Repository": "https://bitbucket.org/hongquan/flask-behind-proxy.git" }, "release_url": "https://pypi.org/project/flask-behind-proxy/0.1.1/", "requires_dist": null, "requires_python": ">=3.4,<4.0", "summary": "Flask middleware to fix HTTPS redirection behind reverse proxy.", "version": "0.1.1" }, "last_serial": 4838372, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "62492ef7857ad5cfdac6c876597eaa5e", "sha256": "797379006b90f4e525a59e2194c89df925f4f8c882120e39f14088f53121b8ca" }, "downloads": -1, "filename": "flask_behind_proxy-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "62492ef7857ad5cfdac6c876597eaa5e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4,<4.0", "size": 4000, "upload_time": "2019-01-02T18:00:23", "url": "https://files.pythonhosted.org/packages/3b/14/2d45f39137ac5bc61b15dbaa50e88ebfaed6e1683cfda8afcaef549201f0/flask_behind_proxy-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5f4a8b656bfd529f5eeaaa015cbfc81a", "sha256": "0e0f333132ee0c1b49de51226611c27d9e19c8abe9c0ded66b8f96650ecd14c1" }, "downloads": -1, "filename": "flask-behind-proxy-0.1.0.tar.gz", "has_sig": false, "md5_digest": "5f4a8b656bfd529f5eeaaa015cbfc81a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4,<4.0", "size": 2929, "upload_time": "2019-01-02T18:00:21", "url": "https://files.pythonhosted.org/packages/8c/07/556394151336db9557d93ab6912993d01cbd33cdd268797aacf77ad84a2b/flask-behind-proxy-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "1ae47af17a669a156de8c98868c910c9", "sha256": "a2bb35eb1e0e7f8425c50b8dc7a5139ae41dab49dab9c344a2e1c9dfe31c09a7" }, "downloads": -1, "filename": "flask_behind_proxy-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1ae47af17a669a156de8c98868c910c9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4,<4.0", "size": 4091, "upload_time": "2019-02-19T07:15:48", "url": "https://files.pythonhosted.org/packages/0c/e6/f6e97c5ee4b308ca59ea4322915bebd0efa9fb2972d27347e204d70825f2/flask_behind_proxy-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "694672b6f0905deb3cbad405ba454c6a", "sha256": "ca82756f78ec4c23420e47148fb2d853b4b9a7a9b9324eb94bb9bbdc44a4a676" }, "downloads": -1, "filename": "flask-behind-proxy-0.1.1.tar.gz", "has_sig": false, "md5_digest": "694672b6f0905deb3cbad405ba454c6a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4,<4.0", "size": 3051, "upload_time": "2019-02-19T07:15:46", "url": "https://files.pythonhosted.org/packages/a1/c5/609a63f32a08751dfa16fc352bc06aaa51fbab74a1515532872efbf64fa3/flask-behind-proxy-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1ae47af17a669a156de8c98868c910c9", "sha256": "a2bb35eb1e0e7f8425c50b8dc7a5139ae41dab49dab9c344a2e1c9dfe31c09a7" }, "downloads": -1, "filename": "flask_behind_proxy-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "1ae47af17a669a156de8c98868c910c9", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4,<4.0", "size": 4091, "upload_time": "2019-02-19T07:15:48", "url": "https://files.pythonhosted.org/packages/0c/e6/f6e97c5ee4b308ca59ea4322915bebd0efa9fb2972d27347e204d70825f2/flask_behind_proxy-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "694672b6f0905deb3cbad405ba454c6a", "sha256": "ca82756f78ec4c23420e47148fb2d853b4b9a7a9b9324eb94bb9bbdc44a4a676" }, "downloads": -1, "filename": "flask-behind-proxy-0.1.1.tar.gz", "has_sig": false, "md5_digest": "694672b6f0905deb3cbad405ba454c6a", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4,<4.0", "size": 3051, "upload_time": "2019-02-19T07:15:46", "url": "https://files.pythonhosted.org/packages/a1/c5/609a63f32a08751dfa16fc352bc06aaa51fbab74a1515532872efbf64fa3/flask-behind-proxy-0.1.1.tar.gz" } ] }