Using standalone nginx with Sentry 10


I’ve been using Sentry 9 on docker with external nginx balancer (external meaning it was installed on the server as a service, not in docker container). I was using uwsgi_pass to proxy requests to sentry.

But in Sentry 10 this approach doesn’t seem to work anymore. The only viable option I’ve found is to use sentry-onpremise’s built-in nginx container, but that’s not flexible enough for me.

Is there any way to use standalone nginx?

Hi @grapes,

We’ve introduced the built-in Nginx container with Sentry 20.7.0 I think (2 versions after 10) but I get what you are saying. You should be able to modify the built-in nginx.conf file to suit your needs or just pass the requests to this Nginx container.

Do any of these work for you? If not, can you provide a bit more info regarding the why?

I have some other web services running on my server, so I cannot expose nginx container to external network - 80 and 443 ports are already in use by standalone nginx.

pass the requests to this Nginx container

This is what I ended up doing. But this approach (nginx -> nginx -> sentry) looks overcomplicated. Keeping two nginx configs is not a good thing - easy to forget or miss something important.

I also tried disabling nginx container and using its config in my standalone nginx, along with mapping docker 9000 and 3000 ports to localhost.

# docker-compose.yml
      - '9000:9000'
      - '3000:3000'
# my standalone nginx conf
location /api/store/ {
location ~ ^/api/[1-9]\d*/ {
location / {

It worked with web, but not with relay (I’m a docker noob, so most likely I did something wrong).

1 Like

I don’t know what your other services are, of course, but if they are all in Docker containers of their own, you might consider using Traefik instead of Nginx. (Disclaimer: I am not affiliated with Traefik, just a happy user.)

I tried to do the same thing as you did with Nginx, but got frustrated by the configuration headaches.

With Traefik, you configure it using Docker labels.

Here is how I have modified the docker-compose.yml to do this:

    << : *restart_policy
    # Don't expose port since we are using Traefik
    #  - '9000:80/tcp'
    image: 'nginx:1.16'
      - type: bind
        read_only: true
        source: ./nginx
        target: /etc/nginx
      - web
      - relay
      - traefik.enable=true
      - traefik.http.routers.sentry.entrypoints=https
      - traefik.http.routers.sentry.rule=Host(``)
      - traefik.http.routers.sentry.tls=true
      - traefik.http.routers.sentry.tls.certresolver=letsencrypt

And here is the configuration for Traefik itself:


    image: traefik:latest
    container_name: traefik
    restart: always
    - "80:80"
    - "443:443"
      - "/var/run/docker.sock:/var/run/docker.sock"  # So that Traefik can listen to the Docker events
      - "./traefik/traefik.toml:/traefik.toml"
      - "./traefik/acme.json:/acme.json" # Traefik uses this to store LetsEncrypt certificates
      - "./traefik/conf:/conf" # This allows setting other configuration, including Basic Auth user credentials for the Traefik monitoring dashboard
      - traefik.enable=true

      # These allow you to see the Traefik monitoring dashboard. You can remove them if you don't need it.
      - traefik.http.routers.traefik.entrypoints=https
      - traefik.http.routers.traefik.rule=Host(``)
      - traefik.http.routers.traefik.tls=true
      - traefik.http.routers.traefik.tls.certresolver=letsencrypt
      - traefik.http.routers.traefik.service=api@internal
      - traefik.http.routers.traefik.middlewares=traefik-dashboard-auth@file


    address = ":80"
      to = "https"
      scheme = "https"

    address = ":443"

  providersThrottleDuration = "2s"

    directory = "/conf"

    watch = true
    endpoint = "unix:///var/run/docker.sock"
    swarmModeRefreshSeconds = "15s"
    exposedbydefault = false

  email = ""
  storage = "acme.json"
    entryPoint = "http"

  dashboard = true

  level = "ERROR"


  users = [

Are you able to share your nginx and relay logs for investigation?

Hi did you managed to get it working over nginx > nginx > uswgi ?