CentOS Stream 9安装nginx

直接安装

dnf install nginx

设置nginx开机启动

systemctl enable nginx

关闭nginx日志以及版本号输出

error_log /dev/null;
access_log  off;
server_tokens off;

启动nginx

systemctl start nginx

在浏览器打开域名或IP地址可以看到安装成功后的效果