军哥进来帮下忙,关于nginx关闭默认站点/空主机头
是不是把下面的内容全部替换成 你的文章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_passunix:/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.logaccess;
}
include vhost/*.conf; 上面server段替换下面server段就行了
回复 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;
军哥是这一段吗?
回复 3# 的帖子
整个server{
.........
}段
也就是到include vhost/*.conf;前面
页:
[1]