domain = 192.168.100.129
serve_from_sub_path = true
# 原来的 root_url root_url = %(protocol)s://%(domain)s:%(http_port)s/ # 修改后的 root_url root_url = %(protocol)s://%(domain)s:%(http_port)s/%(sub_path)s
sub_path 即为上下文 context
sub_path = grafana
#################################### Server ############################## [server] # Protocol (http, https, h2, socket) protocol = http # The ip address to bind to, empty will bind to all interfaces http_addr = # The http port to use http_port = 3000 # The public facing domain name used to access grafana from a browser domain = 192.168.100.129 # Redirect to correct domain if host header does not match domain # Prevents DNS rebinding attacks enforce_domain = false # The full public facing url sub_path = grafana root_url = %(protocol)s://%(domain)s:%(http_port)s/%(sub_path)s # Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons. serve_from_sub_path = true # 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 = cert_key = # Unix socket gid # Changing the gid of a file without privileges requires that the target group is in the group of the process and that the process is the file owner # It is recommended to set the gid as http server user gid # Not set when the value is -1 socket_gid = -1 # Unix socket mode socket_mode = 0660 # Unix socket path socket = /tmp/grafana.sock # CDN Url cdn_url = # Sets the maximum time in minutes before timing out read of an incoming request and closing idle connections. # `0` means there is no timeout for reading the request. read_timeout = 0 # This setting enables you to specify additional headers that the server adds to HTTP(S) responses. [server.custom_response_headers] #exampleHeader1 = exampleValue1 #exampleHeader2 = exampleValue2