1. cat /usr/local/grafana/conf/defaults.ini
# The full public facing url #root_url = %(protocol)s://%(domain)s:%(http_port)s/ root_url = http://localhost:3000/mygrafana/ # 这里要跟外面的url对应上
# url是: https://cyxttest.doonen.net/mygrafana/
2. nginx 的server的配置
location /mygrafana/{ proxy_pass http://localhost:3000/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Server $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; }