Welcome! Log In Create A New Profile

Advanced

Re: Rewrite with number after hyphen

Francis Daly
September 03, 2018 08:38AM
On Mon, Sep 03, 2018 at 08:13:11AM +0200, Ivan Bianchi wrote:

Hi there,

> > location /foo {
> > rewrite /foo/(.*) /web/foo.do?a=$1 last;
> > }

This seems to work as expected for me, using nginx/1.14.0.

> KO:
>
> > https://www.test.com/foo/asdf-12

Why do you think it does not work? What is the input/output/expected
output?

For example, if you add the new location

location = /web/foo.do {
return 200 "$uri$is_args$args\n";
}

and repeat the tests, do you see any difference in output?

> Why if I put a number after a hyphen the regex stops working?

My guesses are:

* you have another location{} that you have configured to match those
requests, so your shown location{} is not involved

or

* your /web/foo.do location-handler handles those requests differently.

Good luck with it,

f
--
Francis Daly francis@daoine.org
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Rewrite with number after hyphen

Ivan Bianchi September 03, 2018 02:14AM

Re: Rewrite with number after hyphen

Francis Daly September 03, 2018 08:38AM

Re: Rewrite with number after hyphen

Ivan Bianchi September 05, 2018 10:26AM

RE: [IE] Re: Rewrite with number after hyphen

jasonw September 05, 2018 02:32PM

Re: [IE] Re: Rewrite with number after hyphen

Ivan Bianchi September 06, 2018 02:38AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 156
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready