Welcome! Log In Create A New Profile

Advanced

Re: block access to a file !!

Francis Daly
June 06, 2012 09:42AM
On Wed, Jun 06, 2012 at 09:22:50AM -0400, torajx wrote:

Hi there,

> it must be a piece of cake but i can not find a soloution...
>
> the problem is " location admin.php". you can check it below...

No, the problem is "location ~ admin.php" coming after "location ~
\.php$". The exact characters matter.

http://nginx.org/r/location

> i just want to allow access to admin.php to some ip address and deny
> others.

Either use something like "location = /admin.php", or maybe reorder to
regex locations (with ~) so they match in the order you want.

You will (probably) want to repeat your fastcgi_pass and other fastcgi_*
config lines inside the new location block. One request is handled by
one location.

Good luck with it,

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

block access to a file !!

torajx June 06, 2012 09:22AM

Re: block access to a file !!

Francis Daly June 06, 2012 09:42AM

Re: block access to a file !!

torajx June 06, 2012 09:50AM

Re: block access to a file !!

Francis Daly June 06, 2012 10:32AM

Re: block access to a file !!

torajx June 09, 2012 02:44AM

Re: block access to a file !!

torajx June 10, 2012 10:53AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 317
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