Home  >  All Categories  >  Dev  >  Nginx Setup for Debian

Nginx Setup for Debian

Install latest stable nginx for debian

Also see here

sudo su
cat <<EOF >> /etc/apt/sources.list.d/nginx.list
deb http://nginx.org/packages/debian/ buster nginx
deb-src http://nginx.org/packages/debian/ buster nginx
EOF
exit
curl -L https://nginx.org/keys/nginx_signing.key | sudo apt-key add -
sudo apt update
sudo apt install nginx

Optional generate nginx conf online🔗

Generate a nginx conf online at here

If nginx conf need dhparam.pem, run :cd /etc/nginx sudo openssl dhparam -dsaparam -out dhparam.pem 4096

Optional install acme.sh🔗

sudo su
wget -O -  https://get.acme.sh | sh -s email=my@example.com
source ~/.bashrc
acme.sh --issue -d example.com --nginx

Optional Install certbot🔗

Install snap🔗

https://snapcraft.io/docs/installing-snapd

sudo apt -y install snapd
sudo snap install core; sudo snap refresh core

https://certbot.eff.org/lets-encrypt/debianbuster-nginx

sudo snap install --classic certbot
sudo snap install certbot-dns-cloudflare
sudo ln -s /snap/bin/certbot /usr/bin/certbot

Generate SSL🔗

sudo certbot --nginx
Category: Dev 
TagsSelf-hosted
Published:  · Updated:   📝 Edit this page

该博客没有评论系统,我正在实验有意义的讨论是否更易在社群中发生,不知道为什么,人在社群中,似乎会有更好的行为规范。然后如果有高质量的讨论,我会手动再精选到原文。为此,我建立了一个 Telegram 讨论群组,你可以在里面讨论这篇文章,点此复制文章标题和链接