Sentry: static files not served as ssl

Created on 7 Dec 2015  路  7Comments  路  Source: getsentry/sentry

I installed the master clone on my server. Nginx and uWSGI are running but my static files are not presented via https.

I added SENTRY_URL_PREFIX=https://mydomain.com and forced it on Nginx, like the documentation said on https://docs.getsentry.com/on-premise/server/nginx/.

But still the files are presented as <link href="http://mydomain.com/_static/sentry/images/favicon.ico" rel="shortcut icon" type="image/png"/>.

Most helpful comment

@jacob-v-dam I just tested and verified this locally.

If you set your Root URL to the https version, static files should be served over https without any issue. This would be the default behavior on a new install if you go through the install wizard.

If you're already past the install wizard, you have a few options:

Go to /manage/settings/ and update there or from CLI:

$ sentry config set system.url-prefix https://mydomain.com

You shouldn't touch SENTRY_URL_PREFIX anymore with master and STATIC_URL shouldn't be needed unless there's some special circumstance.

I'm going to close this now unless there's something more to reproduce on my end.

All 7 comments

Quick workaround you could bind STATIC_URL=SENTRY_URL_PREFIX + '/_static/'

/cc @mattrobenolt

Actually is it possible you dont have the SSL config enabled? If you have master master we are currently neck deep in breaking all of configuration

These are the settings Im referring to:

# SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
# SESSION_COOKIE_SECURE = True

Your workaround fixed it.

I uncommented those lines at the beginning but waren't working.

@jacob-v-dam fwiw, this is in the middle of a complete revamp. In the next day or so, this will be improved. So hang tight. :) I'll check this out today though.

@jacob-v-dam I just tested and verified this locally.

If you set your Root URL to the https version, static files should be served over https without any issue. This would be the default behavior on a new install if you go through the install wizard.

If you're already past the install wizard, you have a few options:

Go to /manage/settings/ and update there or from CLI:

$ sentry config set system.url-prefix https://mydomain.com

You shouldn't touch SENTRY_URL_PREFIX anymore with master and STATIC_URL shouldn't be needed unless there's some special circumstance.

I'm going to close this now unless there's something more to reproduce on my end.

I tested it and it worked!

@mattrobenolt +1

Was this page helpful?
0 / 5 - 0 ratings