docker nginx

docker run -d -p 8081:80 nginxImageID 

浏览器访问:host-ip:8081


2个日志:
access.log,记录每个HTTP请求信息
error.log,记录Nginx运行中的错误,用于排错
配置文件:nginx.conf

docker exec -ti containerID sh

# find . -name "nginx.conf"
./etc/nginx/nginx.conf

# ls -l /etc/nginx
total 32
drwxr-xr-x. 2 root root   25 Dec 16 17:29 conf.d
-rw-r--r--. 1 root root 1007 Dec  9 15:34 fastcgi_params
-rw-r--r--. 1 root root 2837 Dec  9 15:34 koi-utf
-rw-r--r--. 1 root root 2223 Dec  9 15:34 koi-win
-rw-r--r--. 1 root root 3957 Dec  9 15:34 mime.types
-rw-r--r--. 1 root root  643 Dec  9 15:34 nginx.conf
-rw-r--r--. 1 root root  636 Dec  9 15:34 scgi_params
-rw-r--r--. 1 root root  664 Dec  9 15:34 uwsgi_params
-rw-r--r--. 1 root root 3610 Dec  9 15:34 win-utf

# find . -name "access.log"
./var/log/nginx/access.log
# ls -l /var/log/nginx/
total 0
lrwxrwxrwx. 1 root root 11 Dec 16 17:29 access.log -> /dev/stdout
lrwxrwxrwx. 1 root root 11 Dec 16 17:29 error.log -> /dev/stderr

挂载共享目录: /etc/nginx /var/log/nginx

转载于:https://my.oschina.net/u/1186013/blog/669933

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值