我在http://localhost上运行了Google App Engine和Python,这很好用。但是为了使其可靠运行,我需要添加https,Google App Engine没有它。

所以我一直在尝试使用tunnel和apache来使https工作。我尝试了以下操作,但仍然无法正常工作。

NameVirtualHost example.stackoverflow.com:443
<VirtualHost example.stackoverflow.com:443>
  SSLEngine on
  SSLProxyEngine On
  ProxyPreserveHost On
  #ProxyRequests Off

  SSLProtocol all -SSLv2
  SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
  SSLCertificateFile /etc/stunnel/a.crt
  SSLCertificateKeyFile /etc/stunnel/a.key
  SSLCertificateChainFile /etc/stunnel/b.ca

  ServerName localhost
  ProxyPass / http://localhost
  ProxyPassReverse / http://localhost
  #ProxyPassReverseCookiePath /MYSITE/ /
  CacheDisable *
</VirtualHost>


当用户访问:https://example.stackoverflow.com时,基本上他的浏览器地址从https://更改为http://example.stackoverflow.com,并且他能够使用Google App Engine和Python实例。

但是我需要使用我的python为Google App Engine安装https。我该如何解决?

编辑:使用安全但仍然无法正常工作

application: rtc
version: 6
runtime: python27
threadsafe: true
api_version: 1

handlers:
- url: /html
  static_dir: html

- url: /images
  static_dir: images

- url: /js
  static_dir: js

- url: /css
  static_dir: css

- url: /.*
  script: rtc.app
  secure: always

inbound_services:
- channel_presence

libraries:
- name: jinja2
  version: latest

最佳答案

Google App Engine确实支持HTTPS,您只需注册即可。它不是免费的,但也不太昂贵。

有关提供的SSL类型的更多信息,请参见:SSL for a Custom Domain

另外,如果您想自动将用户重定向到安全站点,则可以使用Google App Engine secure配置文件中的app.yaml关键字。请参见Secure URLs

09-10 05:29
查看更多