Dashboard not working due to wrong wp-admin URL
I have installed a WordPress site and I configured it behind a reverse proxy with site URL – https://example.com/blog
I can reach the admin dashboard page at https://example.com/blog/wp-login.php however as I login the dashboard URL is as follows https://example.com/wp-admin ie. it does not have /blog/ in the URL, I cannot go further as the link becomes http://example.com/wp-admin instead of http://example.com/blog/wp-admin.
I read somewhere to change the Request Uri or add a filter but don’t know where to add the code