简体   繁体   English

通过我的 ip:host 不再工作访问我的容器

[英]accessing my container via my ip:host not working anymore

I use docker/docker-compose and nginx on my own server.我在自己的服务器上使用 docker/docker-compose 和 nginx。 I was able to access to my container via external port like my_adress:8080 then i made a redirect via nginx我能够通过像my_adress:8080这样的外部端口访问我的容器,然后我通过 nginx 进行了重定向

{
listen 80
servername my_adress.8080
return 301 https://my_adress.8080
}

and then i removed the nginx conf.然后我删除了 nginx conf。 I restarted nginx services but now i can't access to http://my_adress:8080 anymore there is an automatic redirect 301 to https://my_adress without port 8080我重新启动了 nginx 服务,但现在我无法访问http://my_adress:8080有一个自动重定向301https://my_adress没有端口 8080

I search online how to remove nginx cache or something similar by didn't find it i searched in https://serverfault.com/questions/825331/nginx-still-redirects-even-though-i-removed-the-rule-from-the-conf but diden't find solution我在网上搜索如何删除 nginx 缓存或类似的东西没有找到我在https://serverfault.com/questions/825331/nginx-still-redirects-even-though-i-removed-the-rule- from-the-conf但没有找到解决方案

when i do service docker status i get in CGroup: /system.slice/docker.service当我执行service docker status docker service docker status我进入了CGroup:/system.slice/docker.service

/usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8080 -container-ip 172.19.0.3 -container-port 80

Any ideas why i doesn't work anymore?任何想法为什么我不再工作?

I found where the problem was.我找到了问题所在。

I was using the image https://hub.docker.com/r/onlyoffice/documentserver and i set up the https config我正在使用图像https://hub.docker.com/r/onlyoffice/documentserver并设置了 https 配置

see "Running ONLYOFFICE Docs using HTTPS" in this page : https://helpcenter.onlyoffice.com/installation/docs-community-install-docker.aspx请参阅此页面中的“使用 HTTPS 运行 ONLYOFFICE 文档”: https ://helpcenter.onlyoffice.com/installation/docs-community-install-docker.aspx

And on this image they were an automatic proxy to redirect https to https, so i was not linked to the nginx conf on my server it was only inside the docker-proxy在此图像上,它们是将 https 重定向到 https 的自动代理,因此我没有链接到服务器上的 nginx conf,它仅在 docker-proxy 内部

So the 2 solutions that i found:所以我发现的2个解决方案:

  • remove the https configuration so it would be available in http删除 https 配置,以便它可以在 http 中使用
  • or binding host server port 443 (https) to the 443 port of the ONLYOFFICE container, so the redirection works或将主机服务器端口 443 (https) 绑定到 ONLYOFFICE 容器的 443 端口,以便重定向工作

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从我的Django应用容器中获取主机IP - Get the host IP from my django app container 无法再连接到我的SQL Docker容器 - Cannot connect to my sql docker container anymore 为什么我可以通过主机 web 浏览器中的 localhost 访问我的 Docker-Compose 容器,但不能在容器中访问? - Why am I able to access my Docker-Compose container via localhost in the host web browser but not in the container? 访问在 Linux 主机上的 docker 容器中运行的 PROPER IP 上的服务 - Accessing a service on the PROPER IP running in docker container on a Linux host 如何将主机的IP地址传递给Docker中的容器 - How do I pass the host's IP address to my container in Docker 如何从主机通过其Ip访问Docker容器 - How to access docker container via its Ip from the host 我在 docker 容器中运行 zuul,但我无法通过本地主机上的 postman 连接到它(Windows 10) - I am running zuul in a docker container, but I cant connect to it via postman on my local host (windows 10) 为什么我的 Docker PostgreSQL 容器不再运行? - Why won't my Docker PostgreSQL container run anymore? Docker 容器化。 使用容器名称而不是主机 IP 从其他机器访问容器 - Docker containerization. accessing container from other machine using container name instead of host IP 当我尝试通过 HTTPs 连接我的 docker 时出现错误:x509: certificate is valid for 0.0.0.0, not<my container ip></my> - I got an error when I try to connect my docker via HTTPs: x509: certificate is valid for 0.0.0.0, not <My Container IP>
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM