Dockerfile
FROM nginx:latest
COPY ./default.conf /etc/nginx/conf.d/default.conf
default.conf:
location / {
root /usr/share/nginx/html;
index index.html index.htm;
deny all;
}
docker build -t nginx:20220426 .
为什么 CMD ["nginx" "-g" "daemon off;"]在前, COPY ./default.conf /etc/nginx/conf.d/default.conf 在后, 但配置中的 deny all; 依然生效. 谢谢

