You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(self-hosted): handle reverse proxy cors issues for ingest endpoints (#12513)
<!-- Use this checklist to make sure your PR is ready for merge. You may
delete any sections you don't need. -->
## DESCRIBE YOUR PR
Someone on Discord pointed out that they had CORS issues from the
browser when submitting events to Sentry. This patch is to make sure
that would never happen.
## IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs
to go live.
- [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE -->
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [x] None: Not urgent, can wait up to 1 week+
## SLA
- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!
## PRE-MERGE CHECKLIST
*Make sure you've checked the following before merging your changes:*
- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)
## LEGAL BOILERPLATE
<!-- Sentry employees and contractors can delete or ignore this section.
-->
Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.
## EXTRA RESOURCES
- [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)
Copy file name to clipboardExpand all lines: develop-docs/self-hosted/experimental/external-storage.mdx
+3-2
Original file line number
Diff line number
Diff line change
@@ -4,11 +4,12 @@ sidebar_title: External Storage
4
4
sidebar_order: 90
5
5
---
6
6
7
-
In some cases, storing Sentry data on-disk is not really something people can do. Sometimes, it's better to offload it into some bucket storage (like AWS S3 or Google Cloud Storage).
8
-
9
7
<Alerttitle="Important"level="warning">
10
8
These are community-contributed docs. Sentry does not officially provide support for self-hosted configurations beyond the default install.
11
9
</Alert>
10
+
11
+
In some cases, storing Sentry data on-disk is not really something people can do. Sometimes, it's better to offload it into some bucket storage (like AWS S3 or Google Cloud Storage).
12
+
12
13
<Alerttitle="Note">
13
14
After changing configuration files, re-run the <code>./install.sh</code> script, to rebuild and restart the containers. See the <Linkto="/self-hosted/#configuration">configuration section</Link> for more information.
Copy file name to clipboardExpand all lines: develop-docs/self-hosted/experimental/reverse-proxy.mdx
+90-30
Original file line number
Diff line number
Diff line change
@@ -8,25 +8,25 @@ sidebar_order: 80
8
8
These are community-contributed docs. Sentry does not officially provide support for self-hosted configurations beyond the default install.
9
9
</Alert>
10
10
11
-
Adding a reverse proxy in front of your Sentry deployment is strongly recommended for one big reason: you can fine tune every configuration to fit your current setup. A dedicated reverse proxy that does SSL/TLS termination that also forwards the client IP address as Docker Compose internal network (as this is[close to impossible to get otherwise](https://github.com/getsentry/self-hosted/issues/554))would give you the best Sentry experience.
11
+
Adding a reverse proxy in front of your Sentry deployment is strongly recommended for one big reason: you can fine tune every configuration to fit your current setup. A dedicated reverse proxy that does SSL/TLS termination that also forwards the client IP address as Docker Compose internal network (as this is[close to impossible to get otherwise](https://github.com/getsentry/self-hosted/issues/554))would give you the best Sentry experience.
12
12
13
13
Once you have setup a reverse proxy to your Sentry instance, you should modify the `system.url-prefix` in the `config.yml` file to match your new URL and protocol. You should also update the SSL/TLS section in the `sentry/sentry.conf.py` script, otherwise you may get CSRF-related errors when performing certain actions such as configuring integrations.
14
14
15
-
Keep in mind that all this setup uses single-nodes for all services, including Kafka. For larger loads, you'd need a beefy machine with lots of RAM and disk storage. To scale up even further, you are very likely to use clusters with a more complex tool, such as Kubernetes. Due to self-hosted installations' very custom nature, we do not offer any recommendations or guidance around scaling up. We do what works for us for our thousands of customers over at[sentry.io](https://sentry.io/)and would love to have you over when you feel your local install's maintenance becomes a burden instead of a joy.
15
+
Keep in mind that all this setup uses single-nodes for all services, including Kafka. For larger loads, you'd need a beefy machine with lots of RAM and disk storage. To scale up even further, you are very likely to use clusters with a more complex tool, such as Kubernetes. Due to self-hosted installations' very custom nature, we do not offer any recommendations or guidance around scaling up. We do what works for us for our thousands of customers over at[sentry.io](https://sentry.io/)and would love to have you over when you feel your local install's maintenance becomes a burden instead of a joy.
16
16
17
17
## Enabling HTTPS
18
18
19
-
We recommend TLS termination to be done on your own dedicated load balancer or proxy. Although you can set it on the `nginx.conf` file, it is not recommended as newer self-hosted releases might alter some configurations on the file. Some examples are available on [Reverse Proxy Examples](#reverse-proxy-examples) section.
19
+
We recommend TLS termination to be done on your own dedicated load balancer or proxy. Although you can set it on the `nginx.conf` file provided by the self-hosted installation, it is not recommended as newer self-hosted releases might alter some configurations on the file. Some examples are available on [Reverse Proxy Examples](#reverse-proxy-examples) section.
20
20
21
21
## Expose Only Ingest Endpoint Publicly
22
22
23
23
Certain self-hosted deployments requires the dashboard to be accessed only via internal network. But, they also need to provide public Sentry ingestion endpoint for client devices such as mobile and desktop apps. You can expose some of these endpoints publicly:
24
24
25
-
-`/api/[1-9]\d*/envelope/` - Main endpoint for submitting event from SDK
26
-
-`/api/[1-9]\d*/minidump/` - Endpoint for submitting minidump from native SDKs
27
-
-`/api/[1-9]\d*/security/` - Endpoint for submitting security-related such as CSP errors
28
-
-`/api/[1-9]\d*/store/` - Old endpoint for submitting event from SDK, it is deprecated.
29
-
-`/api/[1-9]\d*/unreal/` - Endpoint for submitting crash report from Unreal Engine SDK
25
+
-`/api/[1-9]\d+/envelope/` - Main endpoint for submitting event from SDK
26
+
-`/api/[1-9]\d+/minidump/` - Endpoint for submitting minidump from native SDKs
27
+
-`/api/[1-9]\d+/security/` - Endpoint for submitting security-related such as CSP errors
28
+
-`/api/[1-9]\d+/store/` - Old endpoint for submitting event from SDK, it is deprecated.
29
+
-`/api/[1-9]\d+/unreal/` - Endpoint for submitting crash report from Unreal Engine SDK
30
30
31
31
The `[1-9]\d+` is a regular expression string that is acquired from the project DSN.
32
32
@@ -71,6 +71,21 @@ server {
71
71
proxy_buffer_size 128k;
72
72
proxy_buffers 4 256k;
73
73
74
+
# Handle CORS-related headers for ingest endpoints.
75
+
# You can also only expose the ingest endpoints only,
76
+
# by removing the other `location` directive.
77
+
#
78
+
# It is recomended to put a rate limiter on the ingest endpoints.
@@ -147,24 +182,39 @@ For detailed documentation on Caddyfile configuration, see [Caddy documentation]
147
182
148
183
[Traefik](https://doc.traefik.io/traefik/) is another reverse proxy that provides a lot of plugin and integrations out of the box. It automatically handles TLS certificate management via ACME, too. After you [install Traefik](https://doc.traefik.io/traefik/getting-started/install-traefik/), add a configuration to Traefik as follows (this example is using the YAML file provider, convert to your prefered configuration provider as needed).
149
184
185
+
The configuration below is intended for Traefik v3 with a File Provider.
186
+
150
187
```yaml
151
188
http:
152
189
routers:
190
+
# Handle CORS-related headers for ingest endpoints.
191
+
# You can also only expose the ingest endpoints only,
192
+
# by removing the other `handle` directive.
193
+
#
194
+
# It is recomended to put a rate limiter on the ingest endpoints.
195
+
sentry-ingest:
196
+
entryPoints:
197
+
- web # Assuming this your HTTP entrypoint
198
+
- websecure # Assuming this is your HTTPS entrypoint
0 commit comments