首頁  >  文章  >  運維  >  nginx在centos7.3下的部署

nginx在centos7.3下的部署

王林
王林轉載
2020-08-26 16:04:012603瀏覽

nginx在centos7.3下的部署

具體步驟:

(推薦教學:nginx教學

1、下載」epel-release」

wget http://dl.Fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

2、安裝」epel-release」軟體包

rpm -ivh epel-release-latest-7.noarch.rpm

3、yum安裝nginx

yum install nginx

4、啟動nginx

systemctl start nginx

5、關閉nginx

systemctl start nginx

6、刷新nginx配置(無需重啟nginx)

nginx -s reload

7、nginx配置

設定檔路徑:/etc/nginx /nginx.conf

注意事項:

(1)

upstream alias{
        server localhost:port;
    }

此處設定服務

(2)

location / {
        proxy_pass http://alias;
    }

( 3)

(1)和(2)alias保持一致

nginx在centos7.3下的部署

#

以上是nginx在centos7.3下的部署的詳細內容。更多資訊請關注PHP中文網其他相關文章!

陳述:
本文轉載於:csdn.net。如有侵權,請聯絡admin@php.cn刪除