Docker配置Nginx

编程

mkdir -p /docker/nginx/conf.d

vim /docker/nginx/conf.d/my.conf

# 自己的配置 我从nginx镜像中复制出来先测试一下

server {

listen 80;

server_name localhost;

location / {

root html;

index index.html index.htm;

}

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

}

mkdir -p /docker/nginx/derts

mkdir -p /docker/nginx/logs

mkdir -p /docker/nginx/html

docker run --privileged=true

--name my-nginx

--network host

-d -p 80:80

-v /docker/nginx/conf.d:/etc/nginx/conf.d

-v /docker/nginx/logs:/var/log/nginx

-v /docker/nginx/html:/etc/nginx/html

nginx

 

以上是 Docker配置Nginx 的全部内容, 来源链接: utcz.com/z/518852.html

回到顶部