appEngine nginx not able to redirect to index.html when the url contains "-" dash

fenglin nginx-forum at forum.nginx.org
Wed Oct 16 09:28:38 UTC 2019


hi ,
I have a problem with gcp AppEngine nginx. I am using the AppEngine flex env
for running my angular application. 
My application use ng-route to control the flows. I have a url of the
following format:
<root_url>/modelview/<parameterSection1/<p2>

in which p2 might contain dash "-" in the url.  

I have default appEngine nginx configuraiton. which I believe will return
the route to index.html which is the entry.
Now I discover if the p2 contains dashes "-"   e.g., AB-cd-1242, the page
returns a whiteLabel error page 404.
if it is a string without "-" it no problem.

I have tried the following ways:
add Nginx-app.conf file with the following configure:

location ^~ /modelview/ {
        try_files $uri $uri/ /index.html;
}


add extra handler in app.yaml file with the following configure:


handlers:
- url: /.*
  secure: always
  script: index.html

- url: /modelview/.*
  secure: always
  script: index.html

non of them can solve the problem.

Is there any mysterious reasons for nginx not able to correctly redirect url
with post fix containing "-"?

We can make a walk around like adding extra post fix. 
e.g.,<root_url>/modelview/<parameterSection1/<p2>/view

can solve the problem.

I just want to figure out why?

can any help to this?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,285897,285897#msg-285897



More information about the nginx mailing list