Quantcast
Channel: Nginx Forum - Nginx Mailing List - Russian
Viewing all articles
Browse latest Browse all 3102

Возможно ли остановить выполнение правил внутри location/выйти из location (4 replies)

$
0
0
Я использую gitlab 12 СE ( 12.9.2 (ac5568eb5d8) ) и nginx из поставки
gitlab (nginx 1.16.1 sha256:f11c2a6d )

кусок моего location с правилами:

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 https://localhost:5002;
access_log /var/log/gitlab/nginx/lfs_lock_access.log gitlab_access;
error_log /var/log/gitlab/nginx/lfs_lock_error.log debug;
}

я хочу обрабатывать все запросы на ^.*.git/info/lfs/locks внутри location,
только если там не содержится lockservice=true в URI, в это случае,
просто выйти из location ( без 404 ) ,т.к. в файле, который я правлю
( /var/opt/gitlab/nginx/conf/gitlab-http.conf ) есть в т.ч. и такое:

location / {
proxy_cache off;
proxy_pass http://gitlab-workhorse;
}

т.е. если есть lockservice=true в URI, то не делать proxy_pass и в
принципе не применять правила из моего location
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru

Viewing all articles
Browse latest Browse all 3102

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>