···179179180180The key with this route is that we only want [*specific paths*](https://doc.traefik.io/traefik/routing/routers/#path-pathprefix-and-pathregexp) to be accessible when Rybbit is accessed from our **external** domain. These routes are:
181181182182+GET
183183+182184* `/api/script.js`
183185* `/api/replay.js`
186186+* `/api/site/[number]/tracking-config`
187187+188188+POST/OPTIONS
189189+184190* `/api/track`
185191* `/api/session-replay/record`
186192187187-We will use Traefik [Path and PathPrefix](https://doc.traefik.io/traefik/routing/routers/#path-pathprefix-and-pathregexp) rules with a [Host](https://doc.traefik.io/traefik/routing/routers/#host-and-hostregexp) rule to achieve this restriction. Additionally, these routes only need to be accessible to rybbit's `backend` service.
193193+194194+We will use Traefik [Path, PathPrefix, and PathRegexp](https://doc.traefik.io/traefik/routing/routers/#path-pathprefix-and-pathregexp) rules with a [Host](https://doc.traefik.io/traefik/routing/routers/#host-and-hostregexp) rule and [Method](https://doc.traefik.io/traefik/routing/routers/#method) rule to achieve this restriction. Additionally, these routes only need to be accessible to rybbit's `backend` service.
188195189196Modify the `labels` for `backend` service from your Rybbit compose file, adding these:
190197191198```yaml
192199- "traefik.http.services.rybbit-ext.loadbalancer.server.port=3001"
193193-- "traefik.http.routers.rybbit-ext.rule=Host(`rybbit.myExtDomain.com`) && (Path(`/api/script.js`) || Path(`/api/replay.js`) || Path(`/api/track`) || PathPrefix(`/api/session-replay/record`) || (PathPrefix(`/api/site`) && PathRegexp(`tracking-config`)))"
200200+- "traefik.http.routers.rybbit-ext.rule=Host(`rybbit.myExtDomain.com`) && ((Method(`GET`) && (Path(`/api/script.js`) || Path(`/api/replay.js`) || PathRegexp(`^/api/site/[0-9]+/tracking-config`))) || ((Method(`POST`) || Method(`OPTIONS`)) && (Path(`/api/track`) || PathPrefix(`/api/session-replay/record`))))"
194201- "traefik.http.routers.rybbit-ext.service=rybbit-ext"
195202```
196203{: file="compose.yaml"}
···210217 rybbit-ext:
211218 #entryPoints: # may need to specify this
212219 # - "websecure"
213213- rule: "Host(`rybbit.myExtDomain.com`) && (Path(`/api/script.js`) || Path(`/api/replay.js`) || Path(`/api/track`) || PathPrefix(`/api/session-replay/record`) || (PathPrefix(`/api/site`) && PathRegexp(`tracking-config`)))"
220220+ rule: "Host(`rybbit.myExtDomain.com`) && ((Method(`GET`) && (Path(`/api/script.js`) || Path(`/api/replay.js`) || PathRegexp(`^/api/site/[0-9]+/tracking-config`))) || ((Method(`POST`) || Method(`OPTIONS`)) && (Path(`/api/track`) || PathPrefix(`/api/session-replay/record`))))"
214221 service: rybbit-ext
215222216223 services: