【发布时间】:2017-07-29 07:28:02
【问题描述】:
我在浏览器中收到此错误:
Mixed Content: The page at 'https://{my-site}' was loaded over HTTPS, but
requested an insecure XMLHttpRequest endpoint 'http://{my-api}'. This request
has been blocked; the content must be served over HTTPS.
我知道我需要以某种方式允许 https。该应用程序使用 Gunicorn 在自定义 Google App Engine 柔性环境中运行该应用程序。它也使用烧瓶。这是我的 app.yaml:
runtime: custom
env: flex
service: flex-module
entrypoint: gunicorn -b :$PORT main:app
是否可以更改可扩展服务代理中的某些设置以在 App Engine 中允许 https?或者我是否需要获取 ssl 证书和密钥并将以下内容添加到我的 app.yaml:
gunicorn -w3 --certfile=server.crt --keyfile=server.key test:app
我也不确定是否需要将其添加到gunicorn.conf.py,如this documentation:
forwarded_allow_ips = '*'
secure_scheme_headers = {'X-APPENGINE-HTTPS': 'on'}
谢谢
【问题讨论】:
标签: google-app-engine gunicorn app-engine-flexible