Nginx 静态站点部署实战
前言 Nginx 是运维接触最多的软件之一。这篇从零开始,把一个静态网站(比如本博客)部署到 Nginx 上的完整流程走一遍。 一、安装 # RHEL 系 dnf install -y nginx # 确认版本并启动 nginx -v systemctl enable --now nginx curl -I http://127.0.0.1/ # 出现 Welcome to nginx 即成功 二、配置文件结构 /etc/nginx/ ├── nginx.conf # 主配置: 全局 + events + http 块 ├── conf.d/ # 独立站点配置(推荐放这里) │ └── *.conf └── mime.types # 扩展名 -> Content-Type 映射 nginx.conf 的 http 块末尾有一行关键配置: ...