我在上面运行了一个Nginx服务器,配置如下
server
{
listen 1.2.3.4:8200;
...
}但是我得到一个错误,说
nginx: [emerg] bind() to 1.2.3.4:8200 failed
errorDetail": "99- Cannot assign requested address但这就是我希望我的Nginx配置的样子。我已经在我的Linux docker容器上设置了一个VNic,地址是"1.2.3.4“。
在搜索一些链接时-看起来像You can't bind to an IP address not assigned to your computer.,但这个IP是通过vNIC分配的!
另外,我只在Docker容器设置中看到这个错误。Nginx配置在我的Azure Linux虚拟机中加载正常。坞站设置中可能缺少的任何设置?
我使用docker-compose来创建docker容器,我的dockerCompose.yaml文件看起来像这样-
version: "3"
services:
dev:
image: <MyImageName>
build:
dockerfile: docker/Dockerfile-build
context: .
ports:
- 8080:80
- 8200:8200
- "127.0.0.1:8083:22"
working_dir: /azure
entrypoint: /bin/bash
cap_add:
- NET_ADMIN发布于 2020-05-21 18:13:49
netstat -ntlp显示哪个进程持有IP:port,所以我使用IP:port终止了该进程,并重新加载了nginx。
https://stackoverflow.com/questions/60856962
复制相似问题