简体   繁体   English

Docker nginx代理后面的compose容器无法访问inte.net

[英]Docker compose container behind nginx proxy cannot access internet

My goal is to set up a reverse proxy to connect to a sentry relay server via ssl. Essentially, the end goal is to forward traffic from a device to sentry.io through sentry relay, and the nginx server is so that this communication be can done through a secure connection.我的目标是设置一个反向代理通过ssl连接到哨兵中继服务器。本质上,最终目标是通过哨兵中继将流量从设备转发到sentry.io,而nginx服务器是这样的通信可以通过安全连接完成。

I have the following docker-compose.yml :我有以下docker-compose.yml

version: '3'
services:
  nginx:
    image: nginx:latest
    container_name: nginx
    volumes:
      - nginx.conf:/etc/nginx/nginx.conf
      - /etc/letsencrypt/:/etc/letsencrypt/
    ports:
      - 80:80
      - 443:443
    networks:
      - relay-network
    environment:
      - ENV=production
      - APPLICATION_URL=http://relay
  relay:
    image: getsentry/relay
    container_name: relay
    command: ["run", "--config", "/etc/relay/"]
    volumes:
      - config/:/etc/relay/
    expose:
      - "80"
    networks:
      - relay-network

networks:
  relay-network:

Through the nginx and relay the logs I can see that I am able to connect to the relay container using an ssl connection.通过 nginx 和中继日志,我可以看到我能够使用 ssl 连接连接到中继容器。 However, all the sentry queries fail due to an invalid project id – I know this to be untrue because when I send messages with the same project id to the real sentry.io (not through my proxy), it works.但是,由于项目 ID 无效,所有哨兵查询都失败了——我知道这是不正确的,因为当我将具有相同项目 ID 的消息发送到真正的哨兵时。io(不是通过我的代理),它起作用了。 My intuition is that the sentry relay server is unable to access the inte.net to verify the project id as real, so it tries to look for local project ids, of which there are none.我的直觉是哨兵中继服务器无法访问 inte.net 以验证项目 ID 是否真实,因此它尝试查找本地项目 ID,但没有。

How can I make sure my relay container can connect to external.networks like sentry.io?如何确保我的中继容器可以连接到 external.networks,如 sentry.io?

Connect to your relay container interactively with docker exec -it relay bash and try to ping something or load a page with curl .使用docker exec -it relay bash以交互方式连接到您的中继容器,并尝试使用curl ping 某些内容或加载页面。 If you want to do that automatically you can use healthcheck .如果您想自动执行此操作,您可以使用healthcheck

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

相关问题 Docker 容器无法在 cisco vpn 后面访问互联网 - Docker container cannot access internet behind cisco vpn 不能从代理后面 docker-compose - Cannot docker-compose from behind a proxy Docker 容器无法访问互联网 - Docker container cannot access internet 如何访问在nginx-proxy后面的theia docker容器上运行的应用程序? - How to access an app running on a theia docker container behind nginx-proxy? docker(-compose): 只能通过 nginx-proxy-manager 访问 wikijs 容器; 502错误的网关 - docker(-compose): access wikijs container only through nginx-proxy-manager; 502 Bad Gateway 无法使用nginx-proxy和dnsmasq在具有docker-compose的容器之间访问虚拟主机 - Cannot access virtual hosts between containers with docker-compose using nginx-proxy and dnsmasq Nginx代理后面的SSL SpringBoot App Docker容器 - SSL SpringBoot App Docker container behind Nginx Proxy 在nginx代理后面的码头工人容器内的Wordpress与ssl - Wordpress inside docker container behind nginx proxy with ssl Docker nginx 代理无法访问 dhprams - Docker nginx proxy cannot access dhprams Docker compose - 限制互联网访问,仅允许通过代理出口 - Docker compose - restrict internet access, allow egress only through proxy
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM