Root_path is not working. Ends in 404

I have tried setting up a root path for my grafana instance as suggested in the below URL
http://docs.grafana.org/installation/behind_proxy/

Configration in my defaults.ini is
root_url = %(protocol)s://%(domain)s:%(http_port)s/grafana

After restarting the grafana server, I am getting 404 error for the below url.
http://localhost:3001/grafana/
And even for the base URL,

To start with you are changing values in the wrong ini file. Changes should be made in the custom.ini -> http://docs.grafana.org/installation/configuration/#config-file-locations

What value did you set for server.domain?

set root_url to the root url you want to use in your browser, so for example root_url = http://myserver/grafana

Then you need a reverse proxy that does the url translation: (required if you want grafana under subpath)

http://docs.grafana.org/installation/behind_proxy/#nginx-configuration

Thank You for the response, I have moved my custom configurations to cusctom.ini,

[server]

The full public facing url

root_url = http://grafana.staged-by-discourse.com/grafana

This is the complete configuration I have in custom.ini

great, so it’s working now?