0

I've got essentially a React app in GAE flexible and a separate API app (Node.JS), also in GAE flexible.

I went through the documentation, and when I run gcloud app domain-mappings list I get:

enter image description here

When I check in SSL verification sites and type in the domain it checks out.

When I type in my custom domain in the address bar as (ex: mydomain.ai) it connects as "Not Secure". Sure, if I explicitly type in https:// all is fine.

Any ideas on how to make it always secure, no matter if user types in https or not? What am I missing?

Maxim
  • 4,075
  • 1
  • 14
  • 23
Ryan Rebo
  • 1,278
  • 2
  • 13
  • 27

1 Answers1

1

Ryan.

Of course you can allow http - but it's security issue.

I don't know if such an operation is possible from the level of the management module, but you can certainly solve it with the principle - redirect. at the proxy / load balancer level.

no matter what http you use (Apache, Nginx etc..)

You can redirect all http domain requests to https in ngix.conf:

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name _;
    return 301 https://$host$request_uri;
}

For example, if the visitor opens http://example.com/page2 in the browser, Nginx will redirect the request to https://example.com/page2.

Piotr Żak
  • 2,046
  • 5
  • 18
  • 30