尝试通过localhost连接到docker容器

时间:2017-11-09 10:20:33

标签: docker nginx linuxmint

我有一个运行nginx和php-fpm for laravel的图像设置,我知道图像正常工作,因为我在实时服务器和本地Ubuntu之前都使用过它。我的问题是我转而使用linux mint并使用相同的命令

那是 docker run --name social-server -itd -v ~/Desktop/nginx/conf/:/etc/nginx/sites-enabled -v ~/Desktop/nginx/logs/:/var/log/nginx --link social-db:mysql -v ~/Desktop/dashboard:/app -v ~/Desktop/secv/:/ssl -p 80:80 -p 443:443 php-base

由于某种原因,我无法通过浏览器中的localhost进行连接。

检查nginx的日志并且它们没有被写入(不是erroraccess)所以它通常不会连接到容器

编辑:浏览器中出现错误

This site can’t be reached

The connection was reset.
Try:
Checking the connection
Checking the proxy and the firewall
ERR_CONNECTION_RESET
ReloadHIDE DETAILS

提前感谢您的帮助

修改

我已经分解了运行命令,发现只有在我添加-v ~/Desktop/nginx/conf:/etc/nginx/sites-enabled

时它才会停止工作

1 个答案:

答案 0 :(得分:0)

正如它在编辑中所说,我打破了运行命令并发现它是 -v ~/Desktop/nginx/conf:/etc/nginx/sites-enabled为什么这是我不知道,但我把它拿出来,一切正常......我只是在容器中使用/ etc / nginx / sites-available / default并编辑它以便我如何工作想。感谢您的所有帮助

相关问题