How to change the default root url in sentry?

You need to set the system.url-prefix value mentioned on the docs to the publicly available URL of you Sentry instance.