亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

Nginx安裝后/etc/nginx/conf.d下沒有default.conf的解決

 更新時間:2023年11月29日 11:39:23   作者:Mortalz7  
nginx.conf是nginx默認加載的配置文件 通過nginx -V可以看nginx默認配置文件路徑,本文主要介紹了Nginx安裝后/etc/nginx/conf.d下沒有default.conf的解決,感興趣的可以了解一下

1 問題:

/etc/nginx/conf.d下面沒有default.conf文件。

2 解決方法

方法一:

自己創(chuàng)建default.conf文件。

vi /etc/nginx/conf.d/default.conf

添加如下內(nèi)容:

server {
    listen       80;
    server_name  localhost;

    #access_log  /var/log/nginx/host.access.log  main;

    location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }

    #error_page  404              /404.html;

    # redirect server error pages to the static page /50x.html
    #
    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
        root   /usr/share/nginx/html;
    }

    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
    #
    #location ~ \.php$ {
    #    proxy_pass   http://127.0.0.1;
    #}

    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
    #
    #location ~ \.php$ {
    #    root           html;
    #    fastcgi_pass   127.0.0.1:9000;
    #    fastcgi_index  index.php;
    #    fastcgi_param  SCRIPT_FILENAME  /scripts$fastcgi_script_name;
    #    include        fastcgi_params;
    #}

    # deny access to .htaccess files, if Apache's document root
    # concurs with nginx's one
    #
    #location ~ /\.ht {
    #    deny  all;
    #}
}

方法二:

重新進行安裝nginx,并修改Nginx的epel源地址。

yum-utils是yum的工具包集合。utils是常用工具的意思。

 yum -y install yum-utils

編輯nginx.repo文件

vi /etc/yum.repos.d/nginx.repo

添加如下內(nèi)容:

[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
module_hotfixes=true

[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
module_hotfixes=true

重新安裝更新下nginx

yum -y install nginx

3 查看

成功!

到此這篇關(guān)于Nginx安裝后/etc/nginx/conf.d下沒有default.conf的解決的文章就介紹到這了,更多相關(guān)Nginx 沒有default.conf內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • nginx搭建文件服務器的詳細過程

    nginx搭建文件服務器的詳細過程

    這篇文章主要介紹了nginx搭建文件服務器,本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2023-06-06
  • Nginx服務器安裝及配置文件與使用詳解

    Nginx服務器安裝及配置文件與使用詳解

    這篇文章主要介紹了Nginx服務器安裝及配置文件與使用詳解 ,小編覺得挺不錯的,現(xiàn)在分享給大家,也給大家做個參考。一起跟隨小編過來看看吧
    2017-01-01
  • Nginx啟動、重啟失敗的一般解決方法和步驟

    Nginx啟動、重啟失敗的一般解決方法和步驟

    這篇文章主要介紹了Nginx啟動、重啟失敗的一般解決方法和步驟,本文沒啥技術(shù)含量,只是一個慣用手法的總結(jié),需要的朋友可以參考下
    2015-07-07
  • nginx+uwsgi啟動Django項目的詳細步驟

    nginx+uwsgi啟動Django項目的詳細步驟

    nginx+uwsgi+django是我們常用的django部署方式。這篇文章主要介紹了nginx+uwsgi啟動Django項目的詳細步驟,非常具有實用價值,需要的朋友可以參考下
    2018-10-10
  • nginx url自動加斜杠及301重定向的問題

    nginx url自動加斜杠及301重定向的問題

    這篇文章主要介紹了nginx url自動加斜杠及301重定向的問題的相關(guān)資料,非常不錯,具有參考借鑒價值,需要的朋友可以參考下
    2016-09-09
  • nginx 偽靜態(tài)化rewrite規(guī)則

    nginx 偽靜態(tài)化rewrite規(guī)則

    用Nginx的朋友可以參考,加到nginx.conf相應主機server段配置中即可!
    2009-10-10
  • Nginx proxy_pass如何到https后端

    Nginx proxy_pass如何到https后端

    這篇文章主要介紹了Nginx proxy_pass如何到https后端問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-05-05
  • 基于nginx access日志格式詳解

    基于nginx access日志格式詳解

    下面小編就為大家分享一篇基于nginx access日志格式詳解,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2018-03-03
  • nginx開啟ws訪問和4層負載的編譯參數(shù)示例

    nginx開啟ws訪問和4層負載的編譯參數(shù)示例

    這篇文章主要為大家介紹了nginx開啟ws訪問和4層負載的編譯參數(shù),有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2023-07-07
  • 解決nginx啟動失敗(bind()?to?0.0.0.0:80?failed,An?attempt?was?made?to?access?a?socket?in...)

    解決nginx啟動失敗(bind()?to?0.0.0.0:80?failed,An?attempt?was?

    這篇文章主要介紹了解決nginx啟動失敗問題(bind()?to?0.0.0.0:80?failed,An?attempt?was?made?to?access?a?socket?in?...),具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-05-05

最新評論