Nginx 环境部署

1 操作过程

  • Nginx 官方网站上获取 Nginx 的最新发行版本 linux_packages,通过命令行验证安装是否完成:

Ubuntu 20.04

  1. apt-get install -y curl gnupg2 ca-certificates lsb-release ubuntu-keyring
  2. echo "deb http://nginx.org/packages/ubuntu focal nginx" > /etc/apt/sources.list.d/nginx.list
  3. curl -o /etc/apt/trusted.gpg.d/nginx_signing.asc https://nginx.org/keys/nginx_signing.key
  4. apt-get update
  5. apt-get install -y nginx
  6. echo > /etc/nginx/conf.d/default.conf
  1. nginx -v

nginx version: nginx/1.20.2