getsentry / getsentry/self-hosted

Using external network for proxy

Open
#1,555 5 comments 0 reactions 0 assignees View on GitHub
Improvement
Dominant language
Shell
Stars
9.6k
Forks
2k
Avg merge
1d 5h
Merged PRs (30d)
15

Description

### Problem Statement

I have faced the issue when trying to use sentry behind nginx proxy.
Here is part of nginx service configuration in docker-compose.yml:
```yaml
services:
nginx:
<<: *restart_policy
# ports:
# - "$SENTRY_BIND:80/tcp"
image: "nginx:1.22.0-alpine"

volumes:
- type: bind
read_only: true
source: ./nginx
target: /etc/nginx
- sentry-nginx-cache:/var/cache/nginx

depends_on:
- web
- relay

environment:
- VIRTUAL_HOST=sentry.local

networks:
- default
- frontend
networks:
frontend:
name: nginxproxy
external: true
```

When I try to open Sentry from browser, I've got error: `failed (111: Connection refused) while connecting to upstream ...` in sentry nginx log.
The same problem was reported in issue #482.

### Solution Brainstorm

I've discovered that error appears when you have the service which named `web` in your external network and docker dns resolve incorrect ip for nginx upstream (returns ip for `web` from external network instead of internal). Would be better if `web` service will be renamed into something unique, like `sentry_web` (since service `web` is fairly common in many projects).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.