添加nginx的官方安装源:
# vim /etc/apt/sources.list
然后:
deb https://nginx.org/packages/debian/ jessie nginx
deb-src https://nginx.org/packages/debian/ jessie nginx
然后:
apt-get update
apt-get install nginx
如果出现错误:
W: GPG error: http://nginx.org jessie InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY ABF5BD827BD9BF62
执行:
wget https://nginx.org/packages/keys/nginx_signing.key
cat nginx_signing.key | apt-key add -
apt update
apt install nginx
启动Nginx:
service nginx start