Centos7安装nginx后提示“Welcome to nginx on Fedora!”怎么解决

问题描述

在腾讯云centos7上安装nginx

sudo yum install nginx

打开默认网页显示

welcome to nginx on fedora!


/etc/nginx/conf.d

目录下无default.conf文件

原因

腾讯云的epel源是默认下载就是fedora的

解决方法

•准备工作

sudo yum install yum-utils

•创建nginx.repo文件

sudo vim /etc/yum.repos.d/nginx.repo

并添加以下内容

[nginx-stable]
name=nginx stable repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=1
enabled=1
gpgkey=https://nginx.org/keys/nginx_signing.key

[nginx-mainline]
name=nginx mainline repo
baseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/
gpgcheck=1
enabled=0
gpgkey=https://nginx.org/keys/nginx_signing.key

•安装nginx

sudo yum install nginx

以上就是Centos7安装nginx后提示“Welcome to nginx on Fedora!”怎么解决的详细内容,更多请关注www.sxiaw.com其它相关文章!