一赡译、下載Nginx Key
wget http://nginx.org/keys/nginx_signing.key
二、apt添加key
apt-key add nginx_signing.key
三不铆、需要添加Nginx源
sed -i '$a deb http://nginx.org/packages/ubuntu/ xenial nginx' /etc/apt/sources.list
sed -i '$a deb-src http://nginx.org/packages/ubuntu/ xenial nginx' /etc/apt/sources.list
四蝌焚、更新Nginx源
apt update
五、安裝
apt install nginx
六誓斥、查看Nginx是否安裝成功
nginx -v
七只洒、外網(wǎng)訪問(wèn)
http://當(dāng)前主機(jī)IP或者域名
注意:防火墻開(kāi)啟狀態(tài),需要對(duì)外網(wǎng)開(kāi)放80端口