Switch form NGINX to AWS ALB

Hi yall,

i am trying to replace the nginx with an AWS ALB.
The only thing that is missing for me is the regex for relay

→ ^/api/[1-9]\d*/

wich endpoints in particular would be covered by this pattern for relay ? , so far i thought that it is only calling /api/store

Thanks in advance !

The intent is to cover all API endpoints starting with /api/ that are NOT /api/0/. All of those are owned by Relay. There are multiple of them, I don’t recommend encoding them into the lb

1 Like

That was it.
On the AWS LB i explicitly made a rule just for web /api/0* and weighted it way higher then relay.

Thx a lot again !

Is there a list of which URL should be covered by which endpoint ?
I’m trying to use the AWS ALB too and the regex in the Helm charts does not work with ALB (path apparently does not support regex ).

So far, I see :

  • /api/0/* for web
  • /api/* for relay
  • /* for web

Is that right ?

1 Like

Yeah, that’s pretty much what I said.

Important

Change the evaluation priority for the Web Rule to a higher value then that of relay, otherwise it can happen that your request that was meant to go to /api/0/* goes to /api/*

Good, I just wanted to spell it out to avoid confusion and to be exhaustive.

FYI, I changed locally my Ingress definition to:

      rules:
      - host: my.sentry.io
        http:
          paths:
          - backend: # To redirect HTTP to HTTPS
              serviceName: ssl-redirect
              servicePort: use-annotation
            path: /* 
          - backend:
              serviceName: sentry-web
              servicePort: 9000
            path: /api/0/*
          - backend:
              serviceName: sentry-relay
              servicePort: 3000
            path: /api/*
          - backend:
              serviceName: sentry-web
              servicePort: 9000
            path: /*

and the service seems to be working.