Http to https 301 redirect on app engine flexible env with Google-managed SSL (spring boot)

853 views
Skip to first unread message

Nicolas Lecrique

unread,
Dec 10, 2017, 4:36:53 PM12/10/17
to Google App Engine
I'm trying to make http to https redirect work with:

-Google managed SSL
-Spring boot app
-on flexible environment
-with custom domain

But from what I understand:
-htaccess doesn't work on app engine
-"secure: always" in app.yaml doesn't work in flexible environment
-gcloud proxy kills https connections


I can't find a way to make the redirect work properly

Would you have a code snippet to make this work ?
Or do i have to make a custom ssl certificate (which is what i would like to avoid) ?

I have dabbled with the following links but without success 

Thank you!

Kenworth (Google Cloud Platform)

unread,
Dec 11, 2017, 2:44:20 PM12/11/17
to google-a...@googlegroups.com
You are right, the 'secure: always' in app.yaml is already deprecated for GAE Flex environment. You can make the redirect work by using "X-Forwarded-Proto" header on your application code. See full article here.

Nicolas Lecrique

unread,
Dec 11, 2017, 4:22:13 PM12/11/17
to Google App Engine
Thanks! I finally made it work by following : https://www.sothawo.com/2015/09/run-a-spring-boot-application-on-openshift-behind-https-only/ (which work as app engine from what i understand)
Reply all
Reply to author
Forward
0 new messages