- 积分
- 48
- 威望
-
- 金钱
-
- 注册时间
- 2010-5-25
- 在线时间
- 小时
- 最后登录
- 1970-1-1
|
此次 /root/lnmp reload 都会提示冲突,军歌帮看看修改哪里?
Reload LNMP...
Reload Nginx configure...
[warn]: conflicting server name "www.baowang.com" on 0.0.0.0:80, ignored
[warn]: conflicting server name "baowang.com" on 0.0.0.0:80, ignored
the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
configuration file /usr/local/nginx/conf/nginx.conf test is successful
- server
- {listen 80;
- server_name _; #default
- return 444; }
- server
- {listen 80;
- server_name www.baowang.com baowang.com;
- if ($host != 'www.baowang.com' ) {
- rewrite ^/(.*)$ http://www.baowang.com/$1 permanent;}
- root /home/wwwroot/www.baowang.com;
- index index.html index.htm index.php;
- #以下为图片防盗链规则
- location ~* \.(gif|jpg|png|swf|flv)$ {
- valid_referers none blocked www.baowang.com baowang.com localhost;
- if ($invalid_referer) {
- rewrite ^/ http://127.0.0.1/;
- #return 404;
- }
- }
- #以上为图片防盗链规则
- #以下这段是为了防止Nginx漏洞
- location ~ .*\.(php|php5)?$
- {if ($request_filename ~* (.*)\.php)
- { set $php_url $1; }
- if (!-e $php_url.php)
- {return 403;}
- #以上这段是为了防止Nginx漏洞
复制代码 |
|