Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Redirect IP to domain

Greetings,

I have a task to provide reliable solution to redirect external IP to domain.

Currently I have a VM with nginx doing:

 

   #redirect to www
    server {
        listen [::]:80 reuseport default_server;
        listen 0.0.0.0:80 reuseport default_server;

        return 301 https://www.$host$request_uri;
    }

 

 

Is there any way to do it serverless? Like external IP + global load balancer config? If so: how?