yum install -y nginx
systemctl start nginx
systemctl enable nginx
###Sample Nginx Config:
# cat /etc/nginx/conf.d/blogsite.com.conf
server {
listen 80;
server_name blogsite.com;
return 301 $scheme://www.blogsite.com$request_uri;
}
server {
listen 80;
server_name www.blogsite.com;
access_log /var/log/nginx/blogsite_access.log;
location / {
root /var/www/blogsite.com/html;
index index.html index.htm;
try_files $uri $uri/ =404;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}