nginx禁止输入IP访问网站应该怎么设置?
刚才查了一下军哥回答过~~server{
listen 80 default; #参数表示这个是默认虚拟主机
server_name _;
rewrite ^(.*) https://www.vpser.net permanent; #跳转到域名
#return 500; #或者返回 500;
}
但是这段代码该用在哪里呢?麻烦解答一下~
回复 1# 的帖子
修改/usr/local/nginx/conf/nginx.conf 中的server那一段 :victory: :handshake 我也想知道,加哪里的? 原帖由 licess 于 2011-3-21 18:01 发表 https://bbs.vpser.net/images/common/back.gif修改/usr/local/nginx/conf/nginx.conf 中的server那一段
军哥可以详细一点吗? - -
回复 5# 的帖子
:Lserver那一段里的
server_name 还不懂的,按照下面修改/usr/local/nginx/conf/nginx.conf里面内容,前后的内容我都给出来了,还不会的就去跳河死!
========================
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
#limit_zonecrawler$binary_remote_addr10m;
server
{
listen 80 default;
return 500;
}
server
{
listen 80;
server_name 123.com;
index index.html index.htm index.php;
root/home/wwwroot;
location ~ .*\.(php|php5)?$
{
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf; 好像下面这样也可以!
gzip on;
gzip_min_length1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
#limit_zonecrawler$binary_remote_addr10m;
server
{
listen 80 default;
return 500;
server_name 123.com;
index index.html index.htm index.php;
root/home/wwwroot;
location ~ .*\.(php|php5)?$
{
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location /status {
stub_status on;
access_log off;
回复 8# 的帖子
放这里是肯定没问题,但123.com的虚拟主机必须删掉,重新添加到别的目录。 下面的这个最简单!再用/root/vhost.sh添加虚拟主机,把网站弄到二级目录里面用就ok啦!/home/wwwroot目录里面不要放网站,哈哈!gzip on;
gzip_min_length1k;
gzip_buffers 4 16k;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_types text/plain application/x-javascript text/css application/xml;
gzip_vary on;
#limit_zonecrawler$binary_remote_addr10m;
server
{
listen 80 default;
return 500;
location ~ .*\.(php|php5)?$
{
fastcgi_passunix:/tmp/php-cgi.sock;
fastcgi_index index.php;
include fcgi.conf;
}
location /status {
stub_status on;
access_log off; 完全看不懂啊,研究下下 我也来学习一下。。。。 最新的0.8版如果按照这个方法,会造成wordpress提示“No input file specified.”
页:
[1]