How To Upgrade nginx version from 1.14.1 to 1.22 on Rocky 8

How To Upgrade nginx version from 1.14.1 to 1.22 on Rocky 8

How To Upgrade nginx version from 1.14.1 to 1.22 on Rocky 8

Step by Step

$ dnf update -y
$ dnf module list nginx
$ dnf module enable nginx:1.22
$ dnf module reset nginx
$ dnf module enable nginx:1.22
$ dnf module list nginx
$ dnf install nginx -y

To Solve ERROR
nginx[2369333]: nginx: [emerg] module “/usr/lib64/nginx/modules/ngx_http_image_filter_module.so” version 1014001 instead of 1022001 in /usr/share>
502 Bad Gateway

$ yum remove nginx-mod*
$ yum install nginx-mod*