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

server {
    listen       80;
    server_name  localhost;

    #charset koi8-r;
    #access_log  /var/log/nginx/log/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;
    #}
}

精简版

server {
    listen       80;
    server_name  localhost;
	location / {
        root   /usr/share/nginx/html;
        index  index.html index.htm;
    }
}
时间: 2024-08-09 02:21:23

/etc/nginx/conf.d/default.conf的相关文章

Nginx配置文件 nginx.conf 和default.conf 讲解

nginx.conf /etc/nginx/nginx.conf ######Nginx配置文件nginx.conf中文详解##### #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数. worker_processes 8; #全局错误日志定义类型,[ debug | info | notice | warn | error | crit ] error_log /usr/local/nginx/logs/error.log in

nginx安装出现:cp: `conf/koi-win' and `/application/nginx-1.6.3/conf/koi-win' are the same file

nginx编译安装时make出现如下错误 make[1]: Leaving directory `/application/nginx-1.6.3' make -f objs/Makefile install make[1]: Entering directory `/application/nginx-1.6.3' test -d '/application/nginx-1.6.3' || mkdir -p '/application/nginx-1.6.3' test -d '/applic

Linux下hosts、host.conf、resolv.conf的区别

/etc/resolv.conf 该文件是DNS域名解析的配置文件,它的格式很简单,每行以一个关键字开头,后接配置参数.resolv.conf的关键字主要有四个,分别是:nameserver   #定义DNS服务器的IP地址domain         #定义本地域名search          #定义域名的搜索列表sortlist         #对返回的域名进行排序 详细说明:nameserver 表明DNS服务器的IP地址.可以有很多行的nameserver,每一个带一个IP地址.在查

Apache下的配置文件httpd.conf、httpd-vhosts.conf 转

Apache下的配置文件httpd.conf.httpd-vhosts.conf(windows) 2013-05-24 22:09 by youxin, 58 阅读, 0 评论, 收藏, 编辑 httpd.conf文件一般存在于apache目录下的conf文件夹中,主要用来配置apache的.http.conf里面的配置介绍: 1.Listen :监听端口,默认情况是80. 2.ServerAdmin :服务器管理员邮箱. 3.ServerName:服务名. 4.DocumentRoot:PH

Linux下hosts、host.conf、resolv.conf

/etc/resolv.conf 该文件是DNS域名解析的配置文件,它的格式很简单,每行以一个关键字开头,后接配置参数. resolv.conf的关键字主要有四个,分别是: nameserver   #定义DNS服务器的IP地址 domain         #定义本地域名 search          #定义域名的搜索列表 sortlist         #对返回的域名进行排序 详细说明: nameserver 表明DNS服务器的IP地址.可以有很多行的nameserver,每一个带一个I

解决方案:虚拟主机是设置在httpd-vhosts.conf还是vhosts.conf还是httpd.conf?

答案是:都可以.但是推荐在vhosts.conf中设置. --官方文档的举例是在httpd.conf中设置的. --百度一下会发现99%都是在httpd-vhosts.conf中设置的.但是这种设置会存在一些问题,比如设置后localhost打不开等等问题,虽然解决方案简单,但是毕竟感觉不太保险. --在vhosts.conf中设置的话,比较简单,而且没有什么幺蛾子问题. <VirtualHost *:80> ServerName localhost DocumentRoot "E:

Apache2.4.6添加虚拟主机提示:NameVirtualHost has no effect and will be removed in the next release /usr/local/apache/conf/extra/httpd-vhosts.conf

[[email protected] conf]# service httpd restart 停止 httpd: [确定] 启动 httpd:AH00548: NameVirtualHost has no effect and will be removed in the next release /usr/local/apache/conf/extra/httpd-vhosts.conf:1 文件 /usr/local/apache/conf/extra/httpd-vhosts.conf

虚拟主机是设置在httpd-vhosts.conf还是vhosts.conf还是httpd.conf

https://blog.csdn.net/weisubao/article/details/43536723 解决方案:虚拟主机是设置在httpd-vhosts.conf还是vhosts.conf还是httpd.conf? 答案是:都可以.但是推荐在vhosts.conf中设置. ——官方文档的举例是在httpd.conf中设置的. ——百度一下会发现99%都是在httpd-vhosts.conf中设置的.但是这种设置会存在一些问题,比如设置后localhost打不开等等问题,虽然解决方案简单

Include conf/extra/httpd-ssl.conf apache 无法启动

如果你搜过到这文章,说明你可能碰到一些同样的问题.因时间关系,我说得简短点. 环境:windows2008r2 用了.wamp2.0搭的php,mysql,apache. 因为我要用到老版的discuz3.0,所以选2.0 现在的微信小程序都要ssl证书的,没办法. 按网上教程,假设安装在c:/wamp/ 在httpd.conf 中添加下列两行(有的话把文件前面的注释“#”符号去掉): LoadModule ssl_module modules/mod_ssl.so Include conf/e