Welcome! Log In Create A New Profile

Advanced

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

October 16, 2019 05:28AM
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?
Subject Author Posted

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

fenglin October 16, 2019 05:28AM

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

fenglin October 16, 2019 09:55AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 91
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready