关于使用桥接模式的docker容器访问unraid的问题


Go to solution Solved by LongYunur,

Recommended Posts

各位好,最近刚刚入坑了unraid,我在使用docker的时候遇到了一些网络问题,目前有一个nextcloud的docker应用,配置的网络模式为host模式(使用unraid主机的ip),端口为80,我想使用nginx docker反向代理这个nextcloud,nginx docker使用的网络模式为自定义brige模式(直接连接局域网并手动分配ip),在使用过程中发现nginx docker无法连接到nextcloud的ip(也就是unraid的ip),请问这是unraid的安全特性还是我的配置有问题?

Link to comment

nextcloud不需要反向代理就能实现https

 

unraid里尽可能少用反向代理实现https 容易出现各种奇怪的配置问题

 

而且除非没得选 不要使用host 尤其是带nginx组件的容器 很容易把unraid的webui也干掉

 

比如你的unraid主机http的端口就是80 那么你nextcloud使用host网络模式也用80就冲突了 

 

建议是数据库容器和nextcloud容器都网络都使用custom:eth设置一个静态IP

 

然后使用nextcloud 自带的https功能

Link to comment
  • Solution
10 hours ago, cpxjaz said:

各位好,最近刚刚入坑了unraid,我在使用docker的时候遇到了一些网络问题,目前有一个nextcloud的docker应用,配置的网络模式为host模式(使用unraid主机的ip),端口为80,我想使用nginx docker反向代理这个nextcloud,nginx docker使用的网络模式为自定义brige模式(直接连接局域网并手动分配ip),在使用过程中发现nginx docker无法连接到nextcloud的ip(也就是unraid的ip),请问这是unraid的安全特性还是我的配置有问题?

需要打开 Docker设置中的 主机访问自定义网络 方可,主机与docker容器的 macvlan 模式 ip进行互通

Link to comment
11 hours ago, lagunapata said:

nextcloud不需要代理实现https

 

unraid里少用各种反向代理实现https容易出现基本的问题配置

 

没有任何值得选择也不要使用主机 特别是带 nginx 组件的

 

你的 unraid 主机的 http 的端口模式就是 80 你不使用云使用主机也就是 80 就可以突破了 

 

建议是数据库容器和nextcloud容器都使用custom:eth都设置一个背景IP

 

然后使用nextcloud自带的https功能

我在nextcloud上找了半天也没找到直接开启https的选项XD,查了一下官方文档,不知道是不是我没找对文档,但是我看官方也是用的反代的方式去实现https的

Link to comment
1 hour ago, cpxjaz said:

我在nextcloud上找了半天也没找到直接开启https的选项XD,查了一下官方文档,不知道是不是我没找对文档,但是我看官方也是用的反代的方式去实现https的

官方是写的挺含糊的……

 

我是配置的/mnt/user/appdata/nextcloud/nginx/site-confs/的default

 

把证书加在server 的 443端口ssl那一部分

 

可以参考这个https://www.cnblogs.com/yaxi-blog/p/14902206.html

 

实际上就是启用了nginx的https

 

官方的文稿是这个https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html

Edited by lagunapata
Link to comment
1 hour ago, lagunapata said:

官方是写的挺含糊的……

 

我是配置的/mnt/user/appdata/nextcloud/nginx/site-confs/的default

 

把证书加在server 的 443端口ssl那一部分

 

可以参考这个https://www.cnblogs.com/yaxi-blog/p/14902206.html

 

实际上就是启用了nginx的https

 

官方的文稿是这个https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html

好的好的,非常感谢,今天把反代关掉测试一下

Link to comment
  • 1 year later...
On 5/15/2022 at 2:24 AM, LongYunur said:

需要打开 Docker设置中的 主机访问自定义网络 方可,主机与docker容器的 macvlan 模式 ip进行互通

你好,请问我启用了主机访问自定义网络,并且保留了用户自定义网络,容器和主机可以互通了.但是每次主机重启后就又不能互通了,需要停止 docker 服务重新设置一次是什么原因啊?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.