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
.. admonition:: Assets Accessible at Multiple Origins
159
+
160
+
It's not uncommon for a web application to be accessible at multiple
161
+
origins. For example:
162
+
163
+
* Website is operable over both ``https`` and ``http``
164
+
* Geolocated web addresses: e.g. ``https://us.example.com``, ``https://eu.example.com``
165
+
* Multiple static CDNs: e.g. ``https://static1.example.com``, ``https://static2.example.com``
166
+
* Customer-specific domains/subdomains
167
+
168
+
In this situation, **identical** JavaScript and source map files may be located
169
+
at two or more distinct origins. If you are dealing with such a deployment, you have
170
+
two choices for naming your uploaded artifacts:
171
+
172
+
1. Upload the same artifact multiple times with each possible URL where it appears, for example:
173
+
174
+
* https://static1.example.com/js/app.js
175
+
* https://static2.example.com/js/app.js
176
+
177
+
2. Alternatively, you can omit the protocol + host and use a special tilde (~) prefixed path like so:
178
+
179
+
~/js/app.js
180
+
181
+
The ~ prefix tells Sentry that for a given URL, **any** combination of protocol and hostname whose path is
182
+
``/js/app.js`` should use this artifact. **ONLY** use this method if your source/sourcemap files
183
+
are identical at all possible protocol/hostname combinations. Note that Sentry will prioritize
184
+
full URLs over tilde prefixed paths if found.
185
+
186
+
155
187
.. _upload-sourcemaps-with-cli:
156
188
157
189
Using Sentry CLI
@@ -243,6 +275,10 @@ Note also that Sentry will resolve relative paths. For example, if you have the
243
275
244
276
Sentry will resolve ``sourceMappingURL`` relative to ``https://example.com/dist/js/`` (the root path from which ``app.min.js`` was served). You will again need to name your source map with the full URL: ``https://example.com/dist/js/app.min.js.map``.
245
277
278
+
If you serve the same assets from multiple origins, you can also alternatively use our tilde (~) path prefix to ignore
279
+
matching against protocol + hostname. In which case, ``~/dist/js/app.min.js.map``, will also work. See: `Assets Accessible at Multiple Origins
0 commit comments