My nginx distribution is from the official nginx repository for Ubuntu 20 Server
Default:
location / {
root / usr / share / nginx / html;
index index.html index.htm;
}
Therefore, I prefer to change it.
Grzegorz
-----Original Message-----
From: nginx [mailto:[email protected]] On Behalf Of Francis Daly
Sent: Sunday, February 21, 2021 4:17 PM
To: [email protected]
Subject: Re: Creating the Directory Structure - static content
On Wed, Feb 17, 2021 at 05:05:42PM +0000, Grzegorz Cześnik wrote:
Hi there,
> /var/www/<domain_name>/public_html
> /var/www/html/<domain_name>
> /var/www/<domain_name>
>
> Are there any benefits to using one of these examples? Is it any freedom in
> what they write about it?
It is "whatever organisation you prefer" -- the nginx application does not care
what that organisation is, so long as it is told what it is, probably by using
the "root" directive.
From a "belt-and-braces" security perspective, I find it good to ensure that
whatever directory is chosen as a "root", *everything* within that directory is
ok for nginx to serve as-is from the filesystem.
That is -- I don't put top-secret-password-file inside that directory and then
hope that no-one asks for it; and I don't put secret-source-code.php inside
that directory and then hope I remember to add config telling nginx not to
serve it directly.
But they are unrelated to what directory structure to use.
If you use a distribution, and that has a preferred layout, use that unless you
have a reason not to.
Cheers,
f
--
Francis Daly [email protected]
_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx
_______________________________________________
nginx mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx