Welcome! Log In Create A New Profile

Advanced

Mixing limit_except breaks rewrite functionality: workaround request

All files from this thread

File Name File Size   Posted by Date  
apple-touch-icon@2.png 6.4 KB open | download Sten Grüner 07/10/2023 Read message
Sten Gruener
June 30, 2023 05:30AM
Dear all,

I trying to mix authentication for POST requests with some
rewrite/proxy_pass logic. This mean that password is required only on
POST/PUT requests.

location /x/ {
limit_except GET OPTIONS {
auth_basic "Write Access";
auth_basic_user_file /etc/nginx/conf.d/htpasswd_write;
}
rewrite ^ $request_uri;
rewrite ^/x/(.*) $1 break;
return 400;
proxy_pass http://server:8081/$uri;
}

The snipped above is not working to to the bug/feature which is known:
https://trac.nginx.org/nginx/ticket/1383


Could someone please provide guidance of whether it is possible to
implement my goal using the proposed map directive from the ticket
itself?


BR and Thanks!
_______________________________________________
nginx mailing list
nginx@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Mixing limit_except breaks rewrite functionality: workaround request

Sten Gruener June 30, 2023 05:30AM

Re: Mixing limit_except breaks rewrite functionality: workaround request

Francis Daly July 09, 2023 07:10PM

Re: Mixing limit_except breaks rewrite functionality: workaround request Attachments

Sten Grüner July 10, 2023 12:28AM

Re: Mixing limit_except breaks rewrite functionality: workaround request

Francis Daly July 10, 2023 11:42AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 164
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready