yumでAmazonLinux2にnginxの最新版をインストールする

##はじめに
nginxの最新版(1.15.8)をAmazonLinux2にインストールしたかったのですが、
普通に`yum install nginx`とするとパッケージがないと言われ、
amazon-linux-extrasだと1.12.2しか選択できない(2019/1/28現在)ので、
最新版をインストールする方法。

##環境
AmazonLinuxは以下のAMIを使用。
amzn2-ami-hvm-2.0.20190115-x86_64-gp2 (ami-0d7ed3ddb85b521a6)

##リポジトリの設定
/etc/yum.repos.d/nginx.repoを作成して以下を書き込む

```text:/etc/yum.repos.d/nginx.repo
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/mainline/centos/7/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key
```

##インストール

```bash
$ sudo yum install nginx -y
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package nginx.x86_64 1:1.15.8-1.el7_4.ngx will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================================================================================================
 Package                                              Arch                                                  Version                                                               Repository                                            Size
=============================================================================================================================================================================================================================================
Installing:
 nginx                                                x86_64                                                1:1.15.8-1.el7_4.ngx                                                  nginx                                                762 k

Transaction Summary
=============================================================================================================================================================================================================================================
Install  1 Package

Total download size: 762 k
Installed size: 2.7 M
Downloading packages:
nginx-1.15.8-1.el7_4.ngx.x86_64.rpm                                                                                                                                                                                   | 762 kB  00:00:02     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : 1:nginx-1.15.8-1.el7_4.ngx.x86_64                                                                                                                                                                                         1/1 
----------------------------------------------------------------------

Thanks for using nginx!

Please find the official documentation for nginx here:
* http://nginx.org/en/docs/

Please subscribe to nginx-announce mailing list to get
the most important news about nginx:
* http://nginx.org/en/support.html

Commercial subscriptions for nginx are available on:
* http://nginx.com/products/

----------------------------------------------------------------------
  Verifying  : 1:nginx-1.15.8-1.el7_4.ngx.x86_64                                                                                                                                                                                         1/1 

Installed:
  nginx.x86_64 1:1.15.8-1.el7_4.ngx                                                                                                                                                                                                          

Complete!
```

## バージョン確認 

```bash
$ nginx -v
nginx version: nginx/1.15.8
```