In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. Create a configuration file docker_nginx.conf locally
server { listen 7070; server_name localhost; charset utf-8; location /files { #nginx directory in docker alias /home/files; expires 1d; allow all; autoindex on; }
2. start 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
Description:
D:\dev\nginx-1.13.6\conf\docker_nginx.con is the address of my native configuration file/etc/nginx/nginx.conf is the configuration file address in docker nginx D:\tools\files is the address of my local folder to share/home/files is the address mapped in docker nginx
3. results
Visit localhost:7070/files to see the final mapped file.
Execute docker exec -it nginx bash to get inside docker nginx. The result is as follows
λ docker exec -it nginx bashroot@178a892f73ce:/# lsbin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr varroot@178a892f73ce:/# cd home/root@178a892f73ce:/home# lsfilesroot@178a892f73ce:/home# cd files/root@178a892f73ce:/home/files# ls2018-08-09 2018-08-13 2018-09-04root@178a892f73ce:/home/files# exitexit
The above is the detailed content of the method steps of building an nginx file server based on docker. For more information about docker building an nginx file server, please pay attention to other related articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.