Forum: NGINX Block

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2974d09ac2541e892966b762aad84943?d=identicon&s=25 RandysPants (Guest)
on 2014-06-26 07:02
(Received via mailing list)
Hello, new to all this so I apologize if my question is not formatted
correctly.

We only allow https from outside our network (via hardware firewall).
I want to block access to usr/share/nginx/html but allow access access
to
usr/share/nginx/html/folder1

I have figured I need to be working with the ssl.conf file and have
successfully blocked /usr/share/nginx/html/folder2 I just cant figure
out
how to deny all for the main html folder while allowing /folder1 to be
accessible.

If I add:
location / {
    deny all;
}

It blocks just fine I just cant figure out how to allow /folder2

Thanks!

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,251176,251176#msg-251176
36a8284995fa0fb82e6aa2bede32adac?d=identicon&s=25 Francis Daly (Guest)
on 2014-06-26 09:59
(Received via mailing list)
On Thu, Jun 26, 2014 at 01:01:13AM -0400, RandysPants wrote:

> If I add:
> location / {
>     deny all;
> }
>
> It blocks just fine I just cant figure out how to allow /folder2

  location /folder2 {}

This does assume there are no other location{} blocks; and it does allow
more than just /folder2/ contents.

http://nginx.org/r/location

for the details, and how to allow only /folder2 contents (by using two
separate location{}s).

  f
--
Francis Daly        francis@daoine.org
This topic is locked and can not be replied to.