在App Engine灵活环境自定义运行时强制使用SSL [英] Force SSL on App Engine Flexible Environment Custom Runtime

查看:189
本文介绍了在App Engine灵活环境自定义运行时强制使用SSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用基于openjdk:8的Dockerfile在App Engine Flexible Custom Runtime上运行Metabase实例。目前,它允许访问 http:// [metabase-project] .appspot.com / https:// [metabase-project] .appspot.com / 。我想通过将所有http流量重定向到https来强制SSL。



Dockerfile看起来像这样:

  FROM openjdk:8 
ADD https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 ./cloud_sql_proxy
ADD http:// downloads.metabase.com/v0.21.1/metabase.jar ./metabase.jar
CMD ./cloud_sql_proxy -instances = $ INSTANCE = tcp:$ MB_DB_PORT -dir = / cloudsql& java -jar ./metabase.jar

我们的app.yaml如下所示:

  service:元数据库
运行时:自定义
env:flex

在普通的App Engine app.yaml文件中,我想添加:

 处理程序:
- url:[something]
secure:总是



但是在自定义运行时中,我们无法访问像这样的处理程序。有没有一种方法来配置灵活的运行时间来执行所有流量的重定向? App Engine Flex不支持处理程序,完全可以:
https://cloud.google。 com / appengine / docs / flexible / java / upgrades#appyaml_changes



如果您需要https://重定向,您需要在应用程序中执行此操作。对不起!


We're running an instance of Metabase on a App Engine Flexible Custom Runtime with a Dockerfile based on openjdk:8. Currently it allows access on http://[metabase-project].appspot.com/ and https://[metabase-project].appspot.com/. I'd like to force SSL by having all http traffic redirected to https.

The Dockerfile looks something like this:

FROM openjdk:8
ADD https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 ./cloud_sql_proxy
ADD http://downloads.metabase.com/v0.21.1/metabase.jar ./metabase.jar
CMD ./cloud_sql_proxy -instances=$INSTANCE=tcp:$MB_DB_PORT -dir=/cloudsql & java -jar ./metabase.jar

Our app.yaml looks like:

service: metabase
runtime: custom
env: flex

In a normal App Engine app.yaml file, I'd want to add:

handlers:
- url: [something]
  secure: always

But in the custom runtime we don't have access to handlers like this. Is there a way to configure the Flexible runtime to perform the redirect for all traffic?

解决方案

App Engine Flex doesn't support handlers, at all: https://cloud.google.com/appengine/docs/flexible/java/upgrading#appyaml_changes

If you need https:// redirects, you need to do it from within your application. Sorry!

这篇关于在App Engine灵活环境自定义运行时强制使用SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆