NGINX-Demos icon indicating copy to clipboard operation
NGINX-Demos copied to clipboard

nginx-regex-tester changed my configuration from regextester.conf

Open zakabluk opened this issue 4 years ago • 2 comments

I wrote to regextester.conf next settings

server {
    listen 9000;
    location / {
        return 200 "Match not found\n";
    }
    location ~ "^/([a-zA-Z]{2})/hq/" {
        return 200 "Match found  Capture Group 1: $1\n";
    }
}

after deploy I get nginx error and into docker container I see that my srttings was changed to

server {
    listen 9000;
    location / {
        return 200 "Match not found\n";
    }
    location ~* ^/([a-zA-Z]{2})/hq/ {
        return 200 "Match found  Capture Group 1: $1\n";
    }
}

OK, I returnet config into conteiner againe, then do nginx -s reload and again get wrong config with

 location ~* ^/([a-zA-Z]{2})/hq/

Why?

zakabluk avatar Aug 31 '21 14:08 zakabluk

NOTE: config changed after press button "test" on the page.

zakabluk avatar Aug 31 '21 15:08 zakabluk

Some regexs in nginx need to be quoted, and this is one because of the {}.

tienidurodad avatar Aug 31 '21 19:08 tienidurodad