NGINX-Demos
NGINX-Demos copied to clipboard
nginx-regex-tester changed my configuration from regextester.conf
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?
NOTE: config changed after press button "test" on the page.
Some regexs in nginx need to be quoted, and this is one because of the {}.