Re: Allow/Deny rules in Location block

2023-01-27 Thread sandeep dubey
Thanks Reinis for the response and suggestions. I made the changes and unfortunately couldn't make it work. Later realised that we are running a Nginx Controller in GKE env., So assuming that the restriction changes should be done at controller level and not in the Nginx (not very sure). On Wed,

RE: Allow/Deny rules in Location block

2023-01-25 Thread Reinis Rozitis
> [error] 11#11: *49 access forbidden by rule, client: 10.48.11.9, server: _, > request: "GET /auth/ HTTP/1.1", host: "http://my.domain.info";, referrer: > "https://my.domain.info"; It seems that the rule is working but at some wrong place, I am not sure how to organise or set the right sequence

Re: Allow/Deny rules in Location block

2023-01-24 Thread sandeep dubey
Thanks Daniel for the reply. I have attached my config file for reference in a previous reply. On Wed, Jan 25, 2023 at 10:58 AM nanaya wrote: > Just adding, if it's `location /auth {}`, it'll also match /autha, /authb, > /authsomething/something, not just limited to /auth/*. > > On Wed, Jan 25,

Re: Allow/Deny rules in Location block

2023-01-24 Thread sandeep dubey
I have attached my config file which may help to understand it better. With this change, I am getting "404 - Not Found" error and in log it says [error] 11#11: *49 access forbidden by rule, client: 10.48.11.9, server: _, request: "GET /auth/ HTTP/1.1", host: "my.domain.info", referrer: " https://

Re: Allow/Deny rules in Location block

2023-01-24 Thread nanaya
Just adding, if it's `location /auth {}`, it'll also match /autha, /authb, /authsomething/something, not just limited to /auth/*. On Wed, Jan 25, 2023, at 01:56, Reinis Rozitis wrote: >> There are other locations like /auth, /auth/, /auth/admin, /auth/admin/ and >> few more which have the same r

RE: Allow/Deny rules in Location block

2023-01-24 Thread Reinis Rozitis
> There are other locations like /auth, /auth/, /auth/admin, /auth/admin/ and > few more which have the same rules. I am trying to restrict access to /auth > and /auth/admin which are sensitive for public access. Do you think removing > "=" can help in this case? '=' in location definition me

Re: Allow/Deny rules in Location block

2023-01-23 Thread sandeep dubey
Thanks Reinis for the reply, There are other locations like /auth, /auth/, /auth/admin, /auth/admin/ and few more which have the same rules. I am trying to restrict access to /auth and /auth/admin which are sensitive for public access. Do you think removing "=" can help in this case? On Mon, Jan

Re: Allow/Deny rules in Location block

2023-01-23 Thread sandeep dubey
Thanks Ian for the reply. I did it because the container was failing to start with the error below, will restrict that too. - > [error] 7#7: *1 connect() failed (111: Connection refused) while > connecting to upstream, client: 10.10.0.38, server: _, request: "GET > /api/saml-links HTTP/1.1", upstr

RE: Allow/Deny rules in Location block

2023-01-23 Thread Reinis Rozitis
> I am trying to restrict some Location block in my Nginx configuration to > specific IPs. Below are the changes I made - > >location = /auth { > } > > Here, the deny rule is not working. Users are still able to access the > page publicly. Am I missing something? Are you s

Re: Allow/Deny rules in Location block

2023-01-23 Thread Ian Hobson
Hi Sandeep, I rather suspect that your top two CIDR allow lines are allowing too many people in. Remove them, and check that only the last two lines are allowed in. Then create the two top addresses very carefully, and test. 1.2.3.4/8 allows all C level addresses of the format 1.*.*.* in. I

Allow/Deny rules in Location block

2023-01-23 Thread sandeep dubey
Hello, I am trying to restrict some Location block in my Nginx configuration to specific IPs. Below are the changes I made - Version: nginx:1.21.0 location / { > proxy_pass http://127.0.0.1:8080; > } > location = /auth { > proxy_pass http://127.0.0.1:8080; >