Is it possible to put sentry behind a reverse proxy and serve from https://www.mydomain.com/sentry . I cannot get sentry to work from /sentry. Has anyone did this ? I have seen a github gist on it. It looks old and not working for me.
I am trying to set the sentry behind nginx reverse proxy. like so, https://stats.ourdomain.de/sentry
# If you're using a reverse SSL proxy, you should enable the X-Forwarded-Proto
# header and enable the settings below
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
SOCIAL_AUTH_REDIRECT_IS_HTTPS = True
# End of SSL/TLS settings
With the above changes, if I access from firefox browser https://stats.ontheweb.de/sentry, I get the following page that says
Please wait while we load an obnoxious amount of JavaScript.
You may need to disable adblocking extensions to load Sentry.
If I access from microsoft edge for linux, then it changes the browser url to https://sentry.ejar.sa/auth/login/sentry/ and gives me 403.
Can someone please tell me what change should I do more to get it work ?
Do you have an adblocker? Can you disable it and try again? I think the one I’ve seen mentioned matches on sentry so try a different name in the URL path?
I am not sure why the nginx is looking for files in /etc/nginx/html/ usually that was /usr/share/nginx/html. The files are obviously not in /etc/nginx/html
If I put location / {...} instead of location /sentri {....} in nginx. Most of the stuff works except one request to POST /sentri/api/1/envelope/?sentry_key=e6700cdcdbba412b957fe11b556c9e1f&sentry_version=7. It is because of the system.url-prefix: 'https://stats.ontheweb.de/sentri. /sentri is being prepended to the /api/1/envelope/ request uri. In short, I can get it to work with www.mydomain.com behind reverse proxy but not with www.mydomain.com/sentry. The latter is the one I wanted.
I am using sentry onpremise version 21.2.0.
Sentry cannot work under a path, it needs to have the full domain to work. If you are only trying to get events behind a specific path/endpoint, Troubleshooting for JavaScript | Sentry Documentation may help you.