1. Create a new configuration file docker_nginx.conf on this machine server { listen 7070; server_name localhost; charset utf-8; location /files { #In docker, nginx's directory alias /home/files; expires 1d; allow all; autoindex on; } 2. Start the command docker run --name nginx -d -p 7070:7070 -v D:\dev\nginx-1.13.6\conf\docker_nginx.conf:/etc/nginx/nginx.conf -v D:\tools\files:/home/files nginx illustrate:
3. Results Visit localhost:7070/files to see the final mapped files. Execute the command docker exec -it nginx bash to enter docker nginx. The result is as follows λ docker exec -it nginx bash root@178a892f73ce:/# ls bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var root@178a892f73ce:/# cd home/ root@178a892f73ce:/home# ls files root@178a892f73ce:/home# cd files/ root@178a892f73ce:/home/files# ls 2018-08-09 2018-08-13 2018-09-04 root@178a892f73ce:/home/files# exit exit The above is the detailed content of the method and steps for building an nginx file server based on docker. For more information about building an nginx file server with docker, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: JavaScript canvas to achieve mirror image effect
>>: Several ways to backup MySql database
KVM stands for Kernel-based Virtual Machine, whic...
Since Zabbix version 3.0, it has supported encryp...
1. Dynamic query rules The dynamic query rules ar...
In the database, both UNION and UNION ALL keyword...
(P4) Web standards are composed of a series of sta...
Table of contents Preface environment Install Cre...
This article shares the specific code of JavaScri...
The animation part of CSS will be blocked by JS, ...
The solution to the problem that Navicat cannot r...
Download: http://dev.mysql.com/downloads/mysql/ U...
Batch replace part of the data of a field in MYSQ...
We know that in general, a function must be calle...
The WeChat mini-program native components camera,...
1. What is master-slave replication? The DDL and ...
1. First, you need to know what will trigger the v...