After using Docker and starting the nginx official image of Docker Hub, there are two configuration files in the container.
One is: /etc/nginx/conf.d/default.conf
The other one is: /etc/nginx/nginx.conf
I don’t know what the difference is between these two files.
So I downloaded the compressed package from the nginx official website to check it out (not yum installation, just downloading),
But there is only nginx.conf in the compressed package, and there is no default .conf,
So enter the container and open it to see, but there is no vi in the container, so it cannot be opened.
Question:
Is there any other way to view the files in the container (other than installing vi)?
nginx.conf is the configuration file loaded by nginx by default
You can view the nginx default configuration file path through
nginx -V
.I have never used docker nginx, but I guess default.conf may be included in nginx.conf. In other words, nginx.conf is the main configuration file, and default.conf is the file that configures a default virtual host.