- 一个公网A服务器建立一个网站,可以通过访问A服务器ip:端口访问到页面。
- 一个公网B服务器,用于反向代理,通过访问公网服务器80端口间接访问A服务器ip:端口的页面
本次使用阿里云服务器B进行nginx配置,先通过apt或yum安装好docker:
apt install docker
yum install docker
在任意目录下创建这两个文件:
cd /你的目录
touch Dockerfile nginx.conf
修改Dockerfile
vim Dockerfile
修改nginx.conf
vim nginx.conf
下拉镜像
docker pull nginx
创建本地镜像(不要忘了这个↓点)
docker build -t rev_http .