1

I have setted up an API Gateway in GCP and now I'm trying to configure GCP's Load Balancing in front of the gateway. In order to do this, what I've done is:

  1. Setted up a internet NEG with port 443 as default and the domain name to the gateway's url (provided by api gateway)
  2. Created a Load Balancer with a backend service associated with the NEG and a global frontend with HTTPS protocol, a static IP address and a managed certificate
  3. Created an A record and in Cloudflare pointed it to the Load Balancer's IP

After setting it up, I try to access the load balancer from within the frontend IP address but I'm getting a 404

Did I miss any step in the configuration of the service?

John Hanley
  • 74,467
  • 6
  • 95
  • 159
Thiago Nascimento
  • 1,073
  • 2
  • 13
  • 40
  • There are several reasons this can happen. Edit your question with details on how you configured the frontend, backend, DNS and certificate. – John Hanley Jan 24 '21 at 23:34
  • @JohnHanley added a fill details, is their any information needed? I basically setted it up with the default configurations – Thiago Nascimento Jan 25 '21 at 00:27
  • What is your Cloudlfare `SSL/TLS encryption mode`? Unless you have it set to `Full` or `Full (strict)` communications between Cloudflare and the Google load balancer will be HTTP. Since you do not have an HTTP listener, 404 is the result. Either change the mode or add an HTTP listener. – John Hanley Jan 25 '21 at 03:05
  • @JohnHanley itś set to ull`so I guess it shouldn't be an issue. Can a HTTP listener solve this? – Thiago Nascimento Jan 25 '21 at 13:10
  • We can only guess as you have not included enough details in your question. How are you making the request that returns 404? – John Hanley Jan 25 '21 at 18:23

1 Answers1

7

Under the hood, API Gateway is hosted on Cloud Run like platform. The same characteristics are enforced, included the routing mode.

I wrote an unrelated article on Internet NEG with Cloud Run, but I'm sure that the solution to add a "custom header" in your internet NEG backend can solve your issue.

Have a try and let me know.

guillaume blaquiere
  • 66,369
  • 2
  • 47
  • 76