Apologies for not being more specific.  You don't need to listen on 443 or
any of that stuff - you just need to look for requests that have http in
the x-forwarded-proto header, and then redirect them to an https url.

For example - here's how this works for Node.js.
https://github.com/JustinBeckwith/yes-https

Chris - is there a similar lib for Go out there?

On Wed, May 3, 2017 at 8:38 PM, <sitmuhammed...@gmail.com> wrote:

> Well, that's indeed possible but currently when I use *http.ListenAndServeTLS
> *to serve with https, after the deployment it raises `server encountered
> a temporary error and could not complete your request.`  error on browser
> and logs say statusDetails: "failed_to_pick_backend".   When I use
> *http.ListenAndServe, *it does not give any error when going into the
> website with http or https which is the problem that I had in the first
> place, http does not directs to https. I don't really know what can I do
> other than try these. Any ideas?
>
> On Wednesday, May 3, 2017 at 11:07:48 AM UTC-5, Justin Beckwith wrote:
>>
>> Greetings!
>> Unfortunately, Flex does not respect the handlers section in your
>> app.yaml.  If you want to enable automatic https redirection today, you
>> need to handle this inside of your application code.
>>
>> There may be libs that do this for you (Chris?) like there are in other
>> languages.
>>
>> We know this isn't ideal, and we're actively trying to figure out how to
>> make it easier.
>>
>> Thanks!
>>
>> On Wed, May 3, 2017 at 8:24 AM, <sitmuha...@gmail.com> wrote:
>>
>>> I have deployed my application without hassle just by running gcloud
>>> app deploy command on GCP. Which takes the flexible environment as
>>> default. Yesterday I made the necessary customizations to have a custom
>>> domain for this app with ssl. Currently it works when I go to any of the
>>> following, http://example.com, https://example.com but I also want to
>>> force people to use https. Currently the http requests work as they are, I
>>> want them to be directed to https. I want to direct any user to
>>> https://example.com when they try to go to the website with http or
>>> without anything at all like example.com. How can this be achieved?
>>>
>>> Here's my app.yaml:
>>>
>>>
>>> api_version: go1
>>> env: flex
>>> runtime: go
>>>
>>>
>>> I already tried to use handlers and secure attributes but it seems they
>>> are not valid for flexible environment.
>>>
>>> Thanks.
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Google App Engine" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to google-appengi...@googlegroups.com.
>>> To post to this group, send email to google-a...@googlegroups.com.
>>> Visit this group at https://groups.google.com/group/google-appengine.
>>> To view this discussion on the web visit https://groups.google.com/d/ms
>>> gid/google-appengine/420b5131-163d-4f00-8f55-5780231dfcb0%
>>> 40googlegroups.com
>>> <https://groups.google.com/d/msgid/google-appengine/420b5131-163d-4f00-8f55-5780231dfcb0%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>>
>> --
>>
>> Justin Beckwith | Google Cloud Platform | @justinbeckwith
>> <http://twitter.com/JustinBeckwith> | http://jbeckwith.com
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to google-appengine+unsubscr...@googlegroups.com.
> To post to this group, send email to google-appengine@googlegroups.com.
> Visit this group at https://groups.google.com/group/google-appengine.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/google-appengine/d76d1134-87ee-4222-ab37-
> 414e90abab97%40googlegroups.com
> <https://groups.google.com/d/msgid/google-appengine/d76d1134-87ee-4222-ab37-414e90abab97%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 

Justin Beckwith | Google Cloud Platform | @justinbeckwith
<http://twitter.com/JustinBeckwith> | http://jbeckwith.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/CADd%3D1Q3nJMXDJG9ieLZ99Ox7s-mYSjLXS%2BQxZ9dx27Umqnq%3DUg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to