8.04 Reverse Proxy Grafana with Nginx - MartinWong06/grafana GitHub Wiki
Install nginx in your machine
sudo apt install nginx -yVerify the nginx installation package
nginx -vsudo service nginx statusAllow Nginx HTTP pass through your firewall
sudo ufw allow 'nginx HTTP'For encrypted (https) traffic
sudo ufw allow 'nginx https'To allow both
sudo ufw allow 'nginx full'Access to default nginx configuration path
cd /etc/nginx/sites-enabledCreate a nginx configuration
sudo nano your_domain.confExample Nginx configuration
server {
listen 80;
listen [::]:80;
server_name your_domain www.your_domain;
location / {
proxy_pass http://localhost:3000;
include proxy_params;
}
}Restart the service to ensure Nginx will reload the latest changes.
sudo service nginx restartsudo service nginx statusIf default configuration file still exist, need to remove it by following command
sudo rm /etc/nginx/sites-enabled/default