Public bug reported:

Hi,
We have nginx vhosts configured that worked for 5 years in a row, and then this 
morning they crashed. 
 
unattended upgrade to nginx 1.24.0-2ubuntu7.16 

In a vhost:

    if ($host ~* ([0-9]+)\.(.*?)\.(.*)) {
        set $pullrequest $1;
        set $repo $2;


Example URL https://1189.lib.prtest.example.org/gcovr/index.html 

It should evaluate to:
pullrequest=1189
repo=lib

Today the result was:
pullrequest=1189
repo=1189


I fixed it locally with this patch. but the cause is unknown. it seems like a 
bug was introduced.

-    if ($host ~* ([0-9]+)\.(.*?)\.(.*)) {
-        set $pullrequest $1;
-        set $repo $2;
+    if ($host ~* "^(?<pullrequest>[0-9]+)\.(?<repo>[^.]+)\.(?<domain>.+)$") {
+        set $pullrequest $pullrequest;
+        set $repo $repo;


or, perhaps, tell me why the original code was faulty and needed to be modify 
this way.

** Affects: nginx (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2164662

Title:
  nginx regex stopped working

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/nginx/+bug/2164662/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to