After installing nginx, Centos7 prompts "Welcome to nginx on Fedora!" How to solve

11-09-2023

problem description

Installing nginx on Tencent Cloud centos7

sudo yum install nginx

Open the default web page display

welcome to nginx on fedora!

and

/etc/nginx/conf.d

There is no default.conf file in the directory.

cause

The epel source of Tencent Cloud is downloaded by default, which is fedora's.

solution

preparatory work/be about to work

sudo yum install yum-utils

Create nginx.repo file.

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

And add the following

[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

Install nginx

sudo yum install nginx

Copyright Description:No reproduction without permission。

Knowledge sharing community for developers。

Let more developers benefit from it。

Help developers share knowledge through the Internet。

Follow us