网站推广.NET

网站推广.NET

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 repobaseurl=http://nginx.org/packages/centos/$releasever/$basearch/gpgcheck=1enabled=1gpgkey=https://nginx.org/keys/nginx_signing.key[nginx-mainline]name=nginx mainline repobaseurl=http://nginx.org/packages/mainline/centos/$releasever/$basearch/gpgcheck=1enabled=0gpgkey=https://nginx.org/keys/nginx_signing.key

•安装nginx

sudo yum install nginx

welcome to nginx on fedora