Remove port in URL?


#1

Is it possible to remove the port in the URL for grafana?

I configured our server to use a custom SSL cert and wanted the URL to display as https://graphs.domain.com but I have to put in https://graphs.domain.com:3000 (or whatever port)

My grafana.ini is below:

#################################### Server ####################################
[server]

Protocol (http or https)

protocol = https

The ip address to bind to, empty will bind to all interfaces

http_addr = 10.10.10.10

The http port to use

;http_port = 3000

The public facing domain name used to access grafana from a browser

domain = https://graphs.domain.com

Redirect to correct domain if host header does not match domain

Prevents DNS rebinding attacks

;enforce_domain = false

The full public facing url you use in browser, used for redirects and emails

If you use reverse proxy and sub path specify full url (with sub path)

root_url = https://graphs.domain.com

Log web requests

;router_logging = false

the path relative working path

;static_root_path = public

enable gzip

;enable_gzip = false

https certs & key file

cert_file = /etc/grafana/grafana.pem
cert_key = /etc/grafana/grafanakey.pem

I had the port specified to 443 but it would not restart the service, kept erroring out

EDIT: Sorry…this was my mistake…forgot about some firewall-cmd rules that were in place. All is good now


#2

Please use a reverse proxy like nginx, haproxy or apache, see documentation.


#3

Hi,
I have the same issue using a reverse proxy, domain is configured to whatever.com but grafana still appends the http_port to URLs…
Regards


#4

Please configure the root_url to your public facing url, i.e. http://whatever.com.