Skip to content

Commit 98f6cf0

Browse files
authored
fix: missing mime types and turning off autoindex for js-sdk endpoint (#3395)
Things weren't as smooth as I thought it would be. ### Legal Boilerplate 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.
1 parent 49e30a7 commit 98f6cf0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

docker-compose.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -457,8 +457,8 @@ services:
457457
volumes:
458458
- type: bind
459459
read_only: true
460-
source: ./nginx
461-
target: /etc/nginx
460+
source: ./nginx.conf
461+
target: /etc/nginx/nginx.conf
462462
- sentry-nginx-cache:/var/cache/nginx
463463
- sentry-nginx-www:/var/www
464464
depends_on:

nginx/nginx.conf nginx.conf

+5-2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ events {
1111

1212

1313
http {
14+
include /etc/nginx/mime.types;
1415
default_type application/octet-stream;
1516

1617
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
@@ -89,8 +90,10 @@ http {
8990
proxy_pass http://relay;
9091
}
9192
location ^~ /js-sdk/ {
92-
autoindex on;
93-
root /var/www/js-sdk;
93+
root /var/www/;
94+
# This value is set to mimic the behavior of the upstream Sentry CDN. For security reasons,
95+
# it is recommended to change this to your Sentry URL (in most cases same as system.url-prefix).
96+
add_header Access-Control-Allow-Origin *;
9497
}
9598
location / {
9699
proxy_pass http://sentry;

0 commit comments

Comments
 (0)