Almost every example I have seen, of people configuring NGINX (mostly with Docker), changes the default file and folder locations. Can someone think of a legitimate reason for this other than personal preference (ex: moving to the industry recognized location for such items)?
Two of the example changes I am seeing are...
1. HTML Location (Root)
The HTML root is being replaced from ...
/use/share/nginx/html/
... to ...
RUN mkdir /srv/www
COPY static-content /srv/www
2. Logs Location
Common log locations are replaced from ...
/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 no expert on etiher Docker nor the Linux file system. I'm just curious if there is some benefit to doing this... again, other than personal preference.
Partial answer: The Filesystem Hierarchy Standard for UNIX-like operating systems suggests that data served by the system is to be found in /srv
.
Why someone would move log files to /etc
, which is often recommended to be mounted read-only for security-reasons, I don't understand. Hopefully someone else can shed some light on this!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With