【发布时间】:2019-08-13 09:04:43
【问题描述】:
我在我的机器(本地主机)上使用 docker 运行 nginx。
当我浏览到 localhost:8080 我希望得到“hello world”,但我得到“Welcome to nginx!”屏幕。
我在配置中遗漏了什么?
docker-compose.yml
web:
image: nginx
volumes:
- ./example.com.conf:/etc/nginx/conf.d/example.com.conf
ports:
- '8080:80'
example.com.conf
server {
location / {
return 200 "hello world";
}
}
我运行命令:
docker-compose up
【问题讨论】:
标签: docker nginx docker-compose