This is my NGINX config while testing GCF. I used OpenResty (NGINX) with some Lua code to make a dynamic upstream api gateway: https://github.com/ernestofreyreg/dynamic-upstream-nginx

Clone it and…

$ export HOSTIP=<your local IP>    // This is only to map to local endpoings$ ./start.sh    // Starts a NGINX and Redis containers
$ redis-cli
127.0.0.1:6379> set "route:<domain>:/" "https://us-central1-<project>-<###>.cloudfunctions.net/your-app-1_0_0"

And you can open that domain and see the redirect taking place.

This is working for me using GCF and nextjs. But now I am more interested in using Kong (https://getkong.org)

Software Engineer @ Coalition Inc., Miami FL

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store