Created
October 17, 2021 09:55
-
-
Save cesarferradas/ae1f95b987cfbbb0d2bf21238629c0fd to your computer and use it in GitHub Desktop.
Script to expose Plausible analytics via SSL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
custom_domain=yourdomain.com | |
certbot_email=user@yourdomain.com | |
sudo apt -qqy update | |
sudo apt -qqy install nginx | |
sudo apt -qqy install certbot python3-certbot-nginx ufw | |
sudo systemctl enable nginx | |
sudo systemctl start nginx | |
ufw allow ssh && ufw allow http && ufw allow https && ufw allow 8000 && ufw --force enable | |
sudo wget https://raw.githubusercontent.com/plausible/hosting/master/reverse-proxy/nginx/plausible -O /etc/nginx/sites-available/plausible | |
sudo sed -i "s/example.com/$custom_domain/" /etc/nginx/sites-available/plausible | |
sudo ln -s /etc/nginx/sites-available/plausible /etc/nginx/sites-enabled/plausible | |
sudo systemctl reload nginx | |
sudo certbot --nginx -d $custom_domain --email $certbot_email --agree-tos --no-eff-email | |
echo "Installation complete" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment