0

i have system of management of projects redmine. Also, i have nginx, like reverse proxy for redmine. So, i need to block some page in redmine, for users. In redmine.conf, i did:

location /projects/wwe/dmsf
{
        auth_basic "Test4";
        auth_basic_user_file /etc/nginx/legalinfopass;
        alias /usr/share/redmine/public;
        try_files $uri @fcgi;
}

I generated htaccess file via htpasswd. It works. But i need to block deeper page. I want something like

location /projects/wwe/dmsf?folder_id=351
{
        auth_basic "Test4";
        auth_basic_user_file /etc/nginx/legalinfopass;
        alias /usr/share/redmine/public;
        try_files $uri @fcgi;
}

But, when i am going to page /projects/wwe/dmsf?folder_id=351, i don't have proposition of password and login. Where i made error ?

Piduna
  • 501
  • 3
  • 10
  • 23
  • Your question isn't clear. Do you want to block access or put a password on? Please include the full nginx.conf to show that it's including redmine.conf – Tim Jul 14 '18 at 01:29
  • The `?folder_id=351` is a query string and is not part of the normalised URI used to evaluate `location` and `rewrite` directives. – Richard Smith Jul 14 '18 at 08:19
  • However, the first `location` block also matches the URL with query string. Do you want to only block a page with a specific query string? – Tero Kilkanen Jul 14 '18 at 08:42
  • @TeroKilkanen yes, i want to block query string. – Piduna Jul 15 '18 at 11:12
  • That is unclear. Do you want to block a page with a specific query string, block any URL with a query string or what? – Tero Kilkanen Jul 15 '18 at 17:13
  • @TeroKilkanen ONLY THIS QUERY `/projects/wwe/dmsf?folder_id=351` – Piduna Jul 15 '18 at 18:08
  • https://serverfault.com/questions/780192/nginx-close-a-location-with-auth-basic-if-a-certain-argument-was-passed has an answer how to implement auth based on a query string. – Tero Kilkanen Jul 15 '18 at 18:52

0 Answers0