<div dir="ltr"><span style="color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px">Я использую gitlab 12 СE ( 12.9.2 (ac5568eb5d8) ) и nginx из поставки gitlab (nginx 1.16.1 sha256:f11c2a6d )</span><div><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px"><br></span></font></div><div><font color="#242729" face="Arial, Helvetica Neue, Helvetica, sans-serif"><span style="font-size:15px">кусок моего location с правилами:<br></span></font><div><pre style="margin-top:0px;margin-bottom:1em;padding:12px 8px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;font-size:13px;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;border-radius:3px;color:rgb(36,39,41)"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;background-color:transparent;white-space:inherit">location /test/lfs_lock_test.git/info/lfs/locks{
 if ( $args ~ "lockservice=true" ) {
  return 404;
  }
 rewrite ^/test/lfs_lock_test.git/(.*) /$1 break;
 proxy_pass <a href="https://localhost:5002">https://localhost:5002</a>;
 access_log  /var/log/gitlab/nginx/lfs_lock_access.log gitlab_access;
 error_log   /var/log/gitlab/nginx/lfs_lock_error.log debug;
}</code></pre><pre style="margin-top:0px;margin-bottom:1em;padding:12px 8px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;border-radius:3px;color:rgb(36,39,41)">я хочу обрабатывать все запросы на  ^.*.git/info/lfs/locks внутри location,<br>только если там не содержится lockservice=true в URI, в это случае, <br>просто выйти из location ( без 404 ) ,т.к. в файле, который я правлю <br>( /var/opt/gitlab/nginx/conf/<span style="font-family:arial,sans-serif;background-color:transparent;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;white-space:normal">gitlab-http.conf ) есть в т.ч. и такое:</span></pre><pre style="margin-top:0px;margin-bottom:1em;padding:12px 8px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-size:13px;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;border-radius:3px;color:rgb(36,39,41)"><pre style="margin-top:0px;margin-bottom:1em;padding:12px 8px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;border-radius:3px"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;background-color:transparent;white-space:inherit">  location / {
    proxy_cache off;
    proxy_pass  <a href="http://gitlab-workhorse">http://gitlab-workhorse</a>;
  }</code></pre><pre style="margin-top:0px;margin-bottom:1em;padding:12px 8px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;border-radius:3px">т.е. если есть  lockservice=true в URI, то не делать proxy_pass и в принципе не применять правила из моего location

</pre>

</pre><pre style="margin-top:0px;margin-bottom:1em;padding:12px 8px;border:0px;font-variant-numeric:inherit;font-variant-east-asian:inherit;font-stretch:inherit;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;font-size:13px;vertical-align:baseline;box-sizing:inherit;width:auto;max-height:600px;overflow:auto;border-radius:3px;color:rgb(36,39,41)"><code style="margin:0px;padding:0px;border:0px;font-style:inherit;font-variant:inherit;font-weight:inherit;font-stretch:inherit;line-height:inherit;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;vertical-align:baseline;box-sizing:inherit;background-color:transparent;white-space:inherit">


 

</code></pre></div></div></div>