Context-path partially working through proxy

I think I’ve already tried all the possible combinations, but I cannot make the nexus work well with custom contextpath

nexus-context-path=/nexus
#nexus-webapp=${bundleBasedir}/nexus
nexus-webapp=/nexus
nexus-webapp-context-path=/nexus

I can make static web resources load now, but I have not managed to get the
/service/extdirect
calls obey context-path. As a result I cannot proxy nexus through nginx based on URL.

Could you please help me out?

It feels like frontend ir not prepending the context-path prefix when making /service/extdirect calls behind proxy.

I had to add a separate non-prefixed mapping in nginx config to route /service/extdirect requests to backend. This configuration works. However if I remove the 2nd proxy forwarder I’m again getting errors in web-gui:

    proxy_set_header Host              $host;
    proxy_set_header X-Real-IP         $remote_addr;
    proxy_set_header X-Forwarded-For   $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Host  $host;
    proxy_set_header X-Forwarded-Port  $server_port;

    location ~ ^/nexus/?(.*)$ {
            proxy_pass http://nexus/nexus/$1$is_args$args;
    }

    location ~ ^/service/extdirect/?(.*)$ {
            proxy_pass http://nexus/nexus/service/extdirect/$1$is_args$args;
    }

EDIT: nexus web-gui works as expected when interacting w/o a proxy : http://nexus.netikras.com:8081/nexus/ . Same configuration.

When querying directly (w/ context path):

Have you tried using our recommended setup from here?

https://help.sonatype.com/repomanager3/installation/run-behind-a-reverse-proxy#RunBehindaReverseProxy-Example:ReverseProxyVirtualHostatCustomContextPath

Thank you, I failed to find that part of docs for several hours. Thank you - it works!