docker安装nginx并配置nginx.conf
程序开发
2023-09-11 16:10:25
拉取nginx镜像
docker pull nignx
查看虚拟机内镜像
启动nginx看看是否成功
docker run -d --name "nginx" -p 80:80 nginx
启动后打开浏览器访问一下,确认是否可用
接下来我想修改 nginx.conf 配置文件,我们需要把我们自己定义的 nginx.conf挂载在 docker 中的nginx
首先创建挂载目录
mkdir -p /usr/dokcer_nginx_data/{conf,conf.d,html,log}
自定义 nginx.conf 文件
server {listen 80;server_name localhost;#charset koi8-r;#access_log logs/host.access.log main;location / {proxy_pass http://39.98.173.195:8080/;index dashboard index;proxy_set_header Host $http_host;proxy_set_header X-Real-IP $remote_addr
标签:
上一篇:
html删除style中样式表,如何移除css样式?
下一篇:
相关文章
-
无相关信息