Q:

Reserve proxy to different locations based on URL subpath

I have different services that will handle different parts of the URL depending on the params being passed
Service offer will handle the route /offer/44 and other routes like /offer/44/calculator the following code successfully handles that. 
 location ^~ /offer {
            location ^~ /offer {
                rewrite ^/offer/(.*)$ /offer/$1 break;
                proxy_pass http://localhost:4000/;
            }
        } 

But my extra layer of complexity comes when I have the url /offer/44/payments/* and that then should be routed through another service
I tried lots of different variants of nesting locations but nothings seems to work for payments. Tried to do something like the following (the redirect is basic right now as i was just trying to make it just redirect... but ideally i want it to take everything after payment and put it into the other service URL)
    location ^~ /offer {
            location ^~ /offer {
                rewrite ^/offer/(.*)$ /offer/$1 break;
                proxy_pass http://localhost:4000/;
            }

            #my ideal /offer/44/payments/*
            location ^/offer/([0-9]+)/payment/(.*)$ {

                proxy_pass http://payment-docker.local:20000/init;
            } 
        } 

So my question is: How do I make local nesting work so that if it sees the word payments after offer it proxy_pass to another service?
UPDATED: 
to make it even more simplistic 
Some of the things i've tried
It seems that what nginx doesnt like is the numbers
This works
# Example URL = http://localhost/offer/
 location ^~ /offer/ {
                proxy_pass http://payment-docker.local:20000/init;
         }

This doesn't work. as soon as there is a number regex it always returns 404
# Example URL = http://localhost/offer/3
     location ^~ /offer/([0-9]+) {
                    proxy_pass http://payment-docker.local:20000/init;
             }
# Example URL = http://localhost/offer/33
     location ^~ "/offer/[\d]{2}" {
                    proxy_pass http://payment-docker.local:20000/init;
             }

A:

Can you try with this ? As far as I can remember, nginX uses the longest match for locations with regexp.
location /offer {
            rewrite ^/offer/(.*)$ /offer/$1 break;
            proxy_pass http://localhost:4000/;
        }

#my ideal /offer/44/payments/*
location ~ ^/offer/([0-9]+)/payment/(.*)$ {
            rewrite ^/offer/([0-9]+)/payment/(.*)$ /init/payment/$2 break;
            proxy_pass http://payment-docker.local:20000;
        } 

