google-app-enginegoogle-cloud-platformload-balancingurl-mapping

URL Map is not working with backend service on Load Balancer Google Cloud


I am setting up URL Maps on our Backend Services with Load Balancer. The issue is that my URL Maps are not working for some reason. When I tried to browse domain.com/path, it shows

The requested URL /bpd was not found on this server.

I do believe I did the correct way, but seems that its still not working.

Please see screenshot below:

[![image][1]][1]

/* - working

/path1 and /path2 - not working, shows error - was not found on this server

app.yaml file:

runtime: python27
api_version: 1
threadsafe: true
service: 
handlers:
- url: /
  static_files: 
  upload: 
  secure: always
  redirect_http_response_code: 301

- url: /(.*)
  static_files: www/\1
  upload: www/(.*)

I also set-up Serverless network endpoint group and connected with Google App Engine for the Backend Services.

Thank you all for your help.


Solution

  • Thanks to your comment, I though I found the mistake. In fact, when you define a URL map in a load balancer, the query path in entry of the load balancer is, by default, forwarded as-is to the backend.

    Let's take your case

    And it doesn't work because in reality you expect <myAddressAppEngine.appspot.com>/*.


    To solve that, you can use advanced mode in the URL map

    enter image description here

    Start by setting the default backends for any URL and any path

    enter image description here

    Then add a new path rule and configure it like this, with a path rewrite to /

    enter image description here