VPS侦探论坛

 找回密码
 注册
查看: 6851|回复: 3

军哥进来帮下忙,关于nginx关闭默认站点/空主机头

[复制链接]
发表于 2014-6-10 19:26:37 | 显示全部楼层 |阅读模式

是不是把下面的内容全部替换成 你的文章https://bbs.vpser.net/viewthread.php?tid=1794&highlight=%E7%A6%81%E6%AD%A2IP里的代码
server {
listen 80 default;
return 500;
}


下面是打开
/usr/local/nginx/conf/nginx.conf 看到的代码


server
        {
                listen 80 default;
                #listen [::]:80 default ipv6only=on;
                server_name www.lnmp.org;
                index index.html index.htm index.php;
                root  /home/wwwroot/default;

                #error_page   404   /404.html;
                location ~ [^/]\.php(/|$)
                        {
                                # comment try_files $uri =404; to enable pathinfo
                                try_files $uri =404;
                                fastcgi_pass  unix:/tmp/php-cgi.sock;
                                fastcgi_index index.php;
                                include fastcgi.conf;
                                #include pathinfo.conf;
                        }

                location /nginx_status {
                        stub_status on;
                        access_log   off;
                }

                location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
                        {
                                expires      30d;
                        }

                location ~ .*\.(js|css)?$
                        {
                                expires      12h;
                        }

                access_log  /home/wwwlogs/access.log  access;
        }
include vhost/*.conf;
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-6-11 08:22:14 | 显示全部楼层


上面server段替换下面server段就行了
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
 楼主| 发表于 2014-6-11 09:21:20 | 显示全部楼层

回复 2# 的帖子


server
        {
                listen 80 default;
                #listen [::]:80 default ipv6only=on;
                server_name www.lnmp.org;
                index index.html index.htm index.php;
                root  /home/wwwroot/default;   

军哥  是这一段吗?
美国VPS推荐: 遨游主机LinodeLOCVPS主机云搬瓦工80VPSVultr美国VPS主机中国VPS推荐: 阿里云腾讯云。LNMP付费服务(代装/问题排查)QQ 503228080
发表于 2014-6-11 16:43:40 | 显示全部楼层

回复 3# 的帖子




整个server
{
.........
}段
也就是到include vhost/*.conf;前面
Linux下Nginx+MySQL+PHP自动安装工具:https://lnmp.org
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|VPS侦探 ( 鲁ICP备16040043号-1 )

GMT+8, 2024-9-25 19:23 , Processed in 0.025842 second(s), 16 queries .

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表