Hi,
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…
i just want to allow access to admin.php to some ip address and deny
others.
if i remove allow line from it it deny all; but when I add allow line it
dont work …
please help me…
I tried too many syntax but no success.
i even add root and index to this location but browser prompt to
download my php file…
please help
here 's my server section of config…very simple
server {
listen 80;
server_tokens off;
server_name www.mysite.com;
access_log /var/log/nginx/mysite.log;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
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.
thank you for reply…
i change it to "location = /admin.php "
and move it above the "location ~ .php$ "
it blocks other IPs but give file not found error for allowed Ips…
the last time I added root to admin.php location the browser promot me
to download admin.php…
On Wed, Jun 06, 2012 at 09:50:57AM -0400, torajx wrote:
thank you for reply…
i change it to "location = /admin.php "
and move it above the "location ~ .php$ "
“”"
Either use something like “location = /admin.php”, or maybe reorder to
regex locations (with ~) so they match in the order you want.
“”"
You’ve done both. That’s ok, but unnecessary.
it blocks other IPs but give file not found error for allowed Ips…
the last time I added root to admin.php location the browser promot me
to download admin.php…
what can I do now ?
“”"
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.
“”"