Strange behavior with my dispatch.yaml

38 views
Skip to first unread message

Alexis Marcou

unread,
Nov 18, 2017, 10:51:20 PM11/18/17
to Google App Engine
Hi,

I just want to understand how to manage correclty the dispatch.yaml.

I have 2 services :
  • Service : default
    • app.yaml :

runtime: php55
service
: default
api_version
: 3

handlers
:
- url: /help/.*
  script
: help.php

- url: .*
  script
: default.php

  • Service : admin
    • app.yaml :

runtime: php55
service
: admin
api_version
: 3

handlers
:
- url: .*
  script
: admin.php


Each PHP file, print the name of the file. For example, default.php shows "default"


So, my problem, is that I don't understand the following behavior in red.


First :

dispatch:
 
# Send all mobile traffic to the mobile frontend.
 
- url: "*/admin/*"
    service
: admin

 
# Default service serves simple hostname request.
 
- url: "*/"
    service
: default

result :

Someone, can explain me why I have this behavior ?

Jordan (Cloud Platform Support)

unread,
Nov 20, 2017, 1:44:09 PM11/20/17
to google-a...@googlegroups.com
Your '- url: "*/"  service: default' rule in your dispatch.yaml is the cause. You specifically specify that any domain '*' without parameters should serve the default service. 

E.g:  'admin-dot-XXXXX.appspot.com' conforms into your '*/' rule, so it will serve your default service. Where as 'admin-dot-XXXXX.appspot.com/help' does not as it has '/help' at the end, and since it also doesn't fall into your '- url: "*/admin/*"' rule either it will fall back to use normal -dot- notation routing rules and serve your admin service. 

- You should therefore remove your  '- url: "*/"' default service rule so that it may properly default onto -dot- notation routing and serve your admin service. Note that when there isn't a rule specified in your dispatch file and there is no -dot- notation used only then will it serve the default service.

Note that Google Groups is for general product discussions only and not for technical support. If you require further technical support it is recommended to post your full detailed questions to Stack Overflow using the supported Cloud tags. 
Reply all
Reply to author
Forward
0 new messages