Why change the location of NGINX files?

Almost every example I've seen of people configuring NGINX (mostly with Docker) changes the location of files and folders by default. Can anyone think of a legitimate reason for this other than personal preference (for example: moving to an industry-recognized location for such items)?

Two of the examples of changes that I see are ...

1. HTML Location (Root)
HTML root is replaced by ...

/use/share/nginx/html/ 

... to ...

 RUN mkdir /srv/www COPY static-content /srv/www 

2. Location of magazines
Shared log locations replaced by ...

 /var/log/nginx/ /var/log/nginx/error.log /var/log/nginx/access.log 

... to ...

 RUN mkdir /etc/nginx/logs \ && touch /etc/nginx/logs/static.log \ && touch /etc/nginx/logs/error.log \ && touch /etc/nginx/logs/access.log 

I'm certainly not an expert on etiher Docker or the Linux file system. I'm just wondering if there is any benefit to this ... again, apart from personal preferences.

+5
source share
1 answer

Partial answer: The file system hierarchy standard for UNIX-like operating systems assumes that the data served by the system can be found in /srv .

Why someone translates the log files to /etc , which is often recommended to be set as read-only for security reasons, I don’t understand. Hope someone else can shed some light on this!

+2
source

Source: https://habr.com/ru/post/1263793/


All Articles