You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
11 months ago | |
---|---|---|
.. | ||
docs | 11 months ago | |
Dockerfile | 11 months ago | |
README.md | 11 months ago |
README.md
构建步骤
- 把前端文件放html目录下
- 运行Dockerfile文件构建镜像 docker build -t nginx:1.25 .
启动说明
- docker run -itd --name nginx-test3 -p8819:80 -p443:443
- e UPSTREAM_WEB_SERVERS=192.168.10.138:8899
-e UPSTREAM_MANAGE_SERVERS=192.168.10.138:8891 nginx:1.25- itd : -itd : 无交互模式启动
- -p8819:80 -p443:443 : 端口映射 必填
- UPSTREAM_WEB_SERVERS : 后端服务器地址,只允许有单个。 必填
- UPSTREAM_MANAGE_SERVERS : 管理服务器地址,只允许有单个。非必填,不填默认与UPSTREAM_WEB_SERVERS相等
- vp/nginx:1.25 构建的镜像名称
注意事项
- 如果需要对后端服务进行负载均衡把 /data/vp/nginx/conf/ 目录挂载出来,然后创建配置文件servers.conf
编辑配置文件:upstream web_servers { server $UPSTREAM_WEB_SERVERS; } upstream manage_servers { server $UPSTREAM_MANAGE_SERVERS; }