nginx - file.htmltoo.com nginx&apache



server {

    listen 80;

    server_name file.htmltoo.com;

    charset utf-8; # 避免中文乱码

    access_log off;

    root /data/file;

    location / {

        autoindex on; # 索引

        autoindex_exact_size on; # 显示文件大小

        autoindex_localtime on; # 显示文件时间

    }

    error_page  404 500 502 503 504  /50x.html;

    location = /50x.html {

        root /data/file;

    }

    if ($http_user_agent ~* "qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot")

        {  

                return 403;  

        }  

}


=====================================================


server {

    listen 80;

    server_name icons.domsn.com;

    charset utf-8; 

    access_log off;

    root   /data/site/go/domsn.static/master/bootstrap/;

    index  index.html index.htm;

    location / {

        autoindex on; # 索引

        autoindex_exact_size on; # 显示文件大小

        autoindex_localtime on; # 显示文件时间

    }

    error_page  404 500 502 503 504  /50x.html;

    location = /50x.html {

        root   /data/site/default;

    }

    location ~ \.php$ {

        root /data/site/go/domsn.static/master/bootstrap/;

        try_files $uri =404;

        fastcgi_pass  php:9000;

        fastcgi_index  index.php;

        fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;

        include        fastcgi_params;

    } 

    if ($http_user_agent ~* "qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot")

        {  

                return 403;  

        } 

}


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回