Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nginx): _assets should rewrite to _static/sentry/dist #3483

Merged
merged 3 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions _integration-test/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ def test_initial_redirect():
assert initial_auth_redirect.url == f"{SENTRY_TEST_HOST}/auth/login/sentry/"


def test_asset_internal_rewrite():
"""Tests whether we correctly map `/_assets/*` to `/_static/dist/sentry` as
we don't have a CDN setup in self-hosted."""
response = httpx.get(f"{SENTRY_TEST_HOST}/_assets/entrypoints/app.js")
assert response.status_code == 200
assert response.headers["Content-Type"] == "text/javascript"


def test_login(client_login):
client, login_response = client_login
parser = BeautifulSoup(login_response.text, "html.parser")
Expand Down
4 changes: 4 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ http {
location / {
proxy_pass http://sentry;
}
location /_assets/ {
proxy_pass http://sentry/_static/dist/sentry/;
proxy_hide_header Content-Disposition;
}
location /_static/ {
proxy_pass http://sentry;
proxy_hide_header Content-Disposition;
Expand Down
Loading