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

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

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

j94305
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

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx
Reply | Threaded
Open this post in threaded view
|

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

j94305
forget about this, after investigation, I discover it is related with some
angular "-" in the url parameter problem.
angular does not allow "-" in url route parameter, it will cause 404 error.

but it does not clearly say the value of the parameter contains problem, and
if we add a extra postfix, the problem can be walk around.
it is not related with nginx.

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

_______________________________________________
nginx mailing list
[hidden email]
http://mailman.nginx.org/mailman/listinfo/nginx