传出HTTPS请求超时

传出HTTPS请求超时

本文介绍了Docker-传出HTTPS请求超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用docker-compose运行我的应用程序。该应用程序包含许多容器。一个容器有一个node.js应用程序,另一个有.net核心应用程序。尝试从任何容器向外部服务器发送HTTPS请求时,请求的超时。

I am running my app using docker-compose. The app contains many containers. One container has a node.js app and other has a .net core app. When trying to send HTTPS requests to an outside server, from any of the containers, the request's timeout.

Docker某种程度上阻止了传出HTTPS请求。

Docker is somehow blocking outgoing HTTPS requests.

在谷歌搜索时,每个人都建议更改MTU,所以我将其更改为1400,但仍然没有运气。

On googling, everyone suggested changing MTU, so I changed it to 1400 but still no luck.

networks:
  backend:
    driver: bridge
    driver_opts:
      com.docker.network.driver.mtu: 1400


推荐答案

最后要使其正常工作,我必须将<$ c中的mtu设置为1300 $ c> docker-compose.yml 文件。还必须更新docker配置文件

Finally to get it working I had to set the mtu to 1300 in docker-compose.yml file. Also had to update the docker config file

/etc/docker/daemon.json 的值为 { mtu:1300}

这篇关于Docker-传出HTTPS请求超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 05:06