Flask redirect function redirects to raw API Gateway url instead of custom domain

 ̄綄美尐妖づ 提交于 2019-12-10 12:13:14

问题


I am using the redirect function in my flask app, but whenever the function triggers it redirects the autogenerated API Gateway domain instead of my own domain, which in turn gives me a message forbidden because it is and was internal url. It works when I run in localhost but as soon as it's AWS it doesn't work. I am using a cloudfront distro to redirect users from http to https.

zappa version: 0.48.2, python: 3.6, zappa_settings.json:

{
  "dev": {
      "app_function": "application.application",
      "aws_region": "eu-north-1",
      "profile_name": "default",
      "project_name": "root",
      "runtime": "python3.6",
      "s3_bucket": "example bucket",
      "domain": "example.com",
      "use_precompiled_packages": true,
      "route53_enabled": true
    }
}

it should redirect to example.com instead it redirects to auto generated aws link

来源:https://stackoverflow.com/questions/57081932/flask-redirect-function-redirects-to-raw-api-gateway-url-instead-of-custom-domai

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!