敲入命令

docker run --name nginx -p 8088:8088 -v /data/nginx_data/log:/var/log/nginx -v /data/nginx_data/conf:/etc/nginx/conf.d -v /data/nginx_data/html:/usr/share/nginx/html -d nginx

-v挂载的目录手动创建

在宿主机目录/data/nginx_data/conf新建配置文件nginx.conf

【docker随笔系列】安装nginx

 

 如果做跨域代理 ip一定注意设定宿主机docker虚拟网卡地址,可以宿主机敲ifconfig查看

注意配置文件server开头,不要从网上照搬,都不能用。

相关文章:

  • 2022-03-07
  • 2021-08-23
  • 2021-10-16
  • 2022-01-30
  • 2021-07-21
  • 2021-11-05
  • 2022-02-24
  • 2021-11-23
猜你喜欢
  • 2021-10-15
  • 2021-08-27
  • 2022-01-04
  • 2021-07-01
  • 2022-02-25
  • 2022-01-23
  • 2021-12-25
相关资源
相似解决方案