nginx 配置文件default.conf

server {
    listen       80;     //默认http端口号
    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;
    #}
}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
nginx.confdefault.confnginx配置文件的两个不同部分。 nginx.confnginx的主配置文件,用于配置全局的nginx设置。它包含了一些重要的配置项,比如worker_processes(工作进程数)、events(事件模型)、http(HTTP服务配置)等。这个文件通常位于/etc/nginx目录下,并且是nginx的主要配置文件default.conf则是一个具体的虚拟主机配置文件,用于配置特定的网站或应用程序。它包含了一些特定的设置,比如server_name(服务器域名)、root(网站根目录)、location(请求匹配规则)等。这个文件通常位于/etc/nginx/conf.d目录下,并且可以根据需要创建多个文件来配置不同的虚拟主机。 简而言之,nginx.conf是全局配置文件,而default.conf是用于具体网站或应用程序的虚拟主机配置文件。通过这两个文件的结合使用,可以实现对nginx的全局配置和特定网站的配置进行灵活控制。<span class=&quot;em&quot;>1</span><span class=&quot;em&quot;>2</span><span class=&quot;em&quot;>3</span> #### 引用[.reference_title] - *1* [解决Centos7安装nginx后提示&ldquo;Welcome to nginx on Fedora!&rdquo;,conf.d目录下无default.conf文件](https://download.csdn.net/download/weixin_38685694/12841995)[target=&quot;_blank&quot; data-report-click={&quot;spm&quot;:&quot;1018.2226.3001.9630&quot;,&quot;extra&quot;:{&quot;utm_source&quot;:&quot;vip_chatgpt_common_search_pc_result&quot;,&quot;utm_medium&quot;:&quot;distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2&quot;}}] [.reference_item style=&quot;max-width: 50%&quot;] - *2* *3* [Nginx配置文件 nginx.confdefault.conf 讲解](https://blog.csdn.net/rdhj5566/article/details/121329006)[target=&quot;_blank&quot; data-report-click={&quot;spm&quot;:&quot;1018.2226.3001.9630&quot;,&quot;extra&quot;:{&quot;utm_source&quot;:&quot;vip_chatgpt_common_search_pc_result&quot;,&quot;utm_medium&quot;:&quot;distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2&quot;}}] [.reference_item style=&quot;max-width: 50%&quot;] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值