$ yum install -y epel-release yum-utils
$ vim /etc/yum.repos.d/nginx.repo
[nginx-stable]
name=nginx stable repo
baseurl=https://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
[nginx-mainline]
name=nginx mainline repo
baseurl=https://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
module_hotfixes=true
$ yum-config-manager --enable nginx-stable
$ yum info nginx
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.kakao.com
* epel: nrt.edge.kernel.org
* extras: mirror.kakao.com
* updates: mirror.kakao.com
Available Packages
Name : nginx
Arch : x86_64
Epoch : 1
Version : 1.21.1
Release : 1.el7.ngx
Size : 790 k
Repo : nginx-mainline/7/x86_64
Summary : High performance web server
URL : https://nginx.org/
License : 2-clause BSD-like license
Description : nginx [engine x] is an HTTP and reverse proxy server, as well as
: a mail proxy server.
$ yum install -y nginx
$ nginx -v
nginx version: nginx/1.21.4
$ systemctl --now enable nginx
$ vim /etc/nginx/nginx.conf
http {
...
server_tokens off;
...
}
출처