当前位置: 首页 > news >正文

富民网站建设美工培训速成班学费

富民网站建设,美工培训速成班学费,找项目网站,郑州seo软件docker安装nginx部署前端项目 拉取镜像 docker pull nginx:1.24.0运行容器 docker run --name nginx -p 80:80 -d nginx:1.24.0创建本地挂载的目录 mkdir -p /docker/nginx/conf mkdir -p /docker/nginx/log mkdir -p /docker/nginx/html复制运行的nginx配置到宿主机上 将…

docker安装nginx部署前端项目

拉取镜像

docker pull nginx:1.24.0

运行容器

docker run --name nginx -p 80:80 -d nginx:1.24.0

创建本地挂载的目录

mkdir -p /docker/nginx/conf
mkdir -p /docker/nginx/log
mkdir -p /docker/nginx/html

复制运行的nginx配置到宿主机上

将容器nginx.conf文件复制到宿主机
docker cp nginx:/etc/nginx/nginx.conf /docker/nginx/conf/nginx.conf
将容器conf.d文件夹下内容复制到宿主机
docker cp nginx:/etc/nginx/conf.d /docker/nginx/conf/conf.d
将容器中的html文件夹复制到宿主机
docker cp nginx:/usr/share/nginx/html /docker/nginx/
将容器中的日志log文件夹复制到宿主机
docker cp nginx:/var/log/nginx/ /docker/nginx/log

上述命令执行完毕删除运行的容器

docker stop 容器id
docker rm 容器id

正式运行

docker run  -p 80:80 -p 5010:5010   --restart=always --name nginxWeb -v /docker/nginx/conf/nginx.conf:/etc/nginx/nginx.conf -v /docker/nginx/conf/conf.d:/etc/nginx/conf.d -v /docker/nginx/log:/var/log/nginx -v /docker/nginx/html:/usr/share/nginx/html -d nginx:1.24.0;

修改配置文件

server {listen       80;listen  [::]:80;server_name  localhost;#access_log  /var/log/nginx/host.access.log  main;location / {root   /usr/share/nginx/html/build;index  index.html index.htm;try_files   $uri   $uri/  /index.html;}#error_page  404              /404.html;# redirect server error pages to the static page /50x.html#error_page   500 502 503 504  /50x.html;location = /50x.html {root   /usr/share/nginx/html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {#    proxy_pass   http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {#    root           html;#    fastcgi_pass   127.0.0.1:9000;#    fastcgi_index  index.php;#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;#    include        fastcgi_params;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {#    deny  all;#}
}server {listen       5010;listen  [::]:5010;server_name  localhost;#access_log  /var/log/nginx/host.access.log  main;location / {root   /usr/share/nginx/html/dist;index  index.html index.htm;try_files   $uri   $uri/  /index.html;}#error_page  404              /404.html;# redirect server error pages to the static page /50x.html#error_page   500 502 503 504  /50x.html;location = /50x.html {root   /usr/share/nginx/html;}# proxy the PHP scripts to Apache listening on 127.0.0.1:80##location ~ \.php$ {#    proxy_pass   http://127.0.0.1;#}# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000##location ~ \.php$ {#    root           html;#    fastcgi_pass   127.0.0.1:9000;#    fastcgi_index  index.php;#    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;#    include        fastcgi_params;#}# deny access to .htaccess files, if Apache's document root# concurs with nginx's one##location ~ /\.ht {#    deny  all;#}
}

修改完成重启容器

docker restart id
http://www.yayakq.cn/news/600125/

相关文章:

  • 做平面设计在什么网站能挣钱影楼手机网站
  • 大气红色礼品公司网站源码软件公司 网站模板
  • 携程网网站推广方式郑州专业做淘宝网站建设
  • 网站建设玖金手指谷哥十一大型图片库网站建设
  • 温州网站建设哪家专业关键词优化哪个好
  • 购物网站需求分析报告建设网站 证件
  • 均安公司网站建设网店网页制作
  • 做购物网站开发价格世界十大网站排名
  • 网站后台如何更换在线qq咨询代码微网站开发平台
  • 网站查询页面设计网站首次备案 多久
  • 巴中建设网站怎样在手机上建立自己的网站
  • 东莞网站开发技术公司灵璧有做公司网站的吗
  • 太原网站建设搭建vps做网站用什么系统
  • 滑县网站建设公司电商软件定制
  • 张家界网站建设那里有制作网站公司
  • 中山网站建设是什么意思杭州网站建设seo优化营销制作
  • 建设银行金牛支行网站网站建设电话销售
  • 网站首页广告代码那个网站是响应式的
  • 做网站建立数据库wordpress远程图片发布模块
  • 长春建设工程管理中心网站wordpress 邮箱
  • asp网站的安全性设计宝
  • 企业建网站的少了网站的二级域名
  • 网络营销的网站的分析即时通讯软件
  • 哈尔滨公司网站建设wordpress怎么加滑块
  • 云南网站推广的目的视频拍摄器材
  • 网站备案证书安装淮北建网站费用
  • 上海域名网站吗中国电信黄页官网
  • 前端做学校网站教务网站能找到做网站的人
  • 推广网站建设语句备案期间关闭网站
  • 产品网站推广站长之家 网站模板