23 lines
611 B
Markdown
23 lines
611 B
Markdown
|
# NGINX配置宿主机挂载目录
|
||
|
1. 克隆项目
|
||
|
```bash
|
||
|
git clone https://gitea.xiaokeaii.top/yinxiaolong/nginx_proxy.git
|
||
|
```
|
||
|
2. 进入目录
|
||
|
```bash
|
||
|
cd nginx_proxy
|
||
|
```
|
||
|
3. 使用docker创建nginx容器
|
||
|
```bash
|
||
|
docker run -p 8080:80 --name nginx_proxy \ # 启动的容器名称
|
||
|
-v `pwd`/conf.d:/etc/nginx/conf.d \ # 映射站点配置文件
|
||
|
-v `pwd`/html:/usr/share/nginx/html \ # 映射站点根目录
|
||
|
-v `pwd`/logs:/var/log/nginx/ # 映射日志目录
|
||
|
nginx
|
||
|
```
|
||
|
![启动截图](https://oss2.xiaokeaii.top/2023/启动nginx.png)
|
||
|
|
||
|
1. 访问站点
|
||
|
```bash
|
||
|
http://localhost:8088
|
||
|
```
|