ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Как правильно переписат ь реврайты Joomla под nginx ?



07.04.2011 15:00, Vladislav V. Prodan пишет:
nginx/0.7.67

На чистой джумле работает без особых проблем, а вот подключаю плагин
JoomlaSEF и сразу зацикливание.

Заранее благодарю за умные мысли.
Ниже сам конфиг nginx'a



--
Vladislav V. Prodan
VVP24-UANIC
+380[67]4584408
+380[99]4060508
vlad11@xxxxxxxxx
server {
        listen xxx.xxx.xxx.82:80;
        server_name www.яюир.com;
        location  ~ /\. {
                        deny all;
        }
        rewrite ^ http://яюир.com$request_uri? permanent;
}

server {
        listen xxx.xxx.xxx.82:80;
        server_name *.яюир.com яюир.com;
        access_log /www/яюир/data/logs/яюир.com.access.log;
        error_log  /www/яюир/data/logs/яюир.com.error.log debug;
        charset windows-1251;


### redirect
        rewrite ^/component/option,com_frontpage/Itemid,1/(.*)$   /  permanent;
###


        ###http://server-tuning.info/nginx/auto-subdomains.html
        root       /www/яюир/data/www/яюир.com/$subdomain;
        set $subdomain "";
        if ($host ~* ^www\.([a-z0-9-]+)\.яюир.com$) {
                set $subdomain "subdomain/$1";
        }
        if ($host ~* ^([a-z0-9-]+)\.яюир.com$) {
                set $subdomain "subdomain/$1";
        }

        location / {
             index index.php index.html;
        }

        location  ~ /\. {
                        deny all;
        }



#stop image, video and files hotlinking
        location ~* 
^.+\.(gif|jpg|jpeg|png|swf|flv|css|rar|zip|mpg|mpeg|wmv|avi)$ {
            valid_referers none blocked                   яюир.com *.яюир.com *.google.com *.yahoo.com;
            if ($invalid_referer) {
                    return 444;
            }
        }
               
                              
        if ( $args ~ "mosConfig_[a-zA-Z_]{1,21}(=|\%3d)" ) {
                set $args "";
                rewrite ^.*$ http://$host/index.php last;
                return 403;
        }
                                        
        if ( $args ~ "base64_encode.*\(.*\)" ) {
                set $args "";
                rewrite ^.*$ http://$host/index.php last;
                return 403;
        }

        if ( $args ~ "(\<|%3C).*script.*(\>|%3E)" ) {
                set $args "";
                rewrite ^.*$ http://$host/index.php last;
                return 403;
        }

        if ( $args ~ "GLOBALS(=|[|\%[0-9A-Z]{0,2})" ) {
                set $args "";
                rewrite ^.*$ http://$host/index.php last;
                return 403;
        }

        if ( $args ~ "_REQUEST(=|[|\%[0-9A-Z]{0,2})" ) {
                set $args "";
                rewrite ^.*$ http://$host/index.php last;
                return 403;
        }
                                                                                
                

# defense against hotlink       
#       location ~ \.flv$ {
#               flv;
#       }

#       location ~ \.(jpg|jpeg|gif|mpg|mpeg|wmv|avi|flv)$ {
#           access_log off;
#           valid_referers none blocked server_names !~яюир.com;
#                   if ($invalid_referer) {
#                   return 403;
#           }
#       }                                   



        location ~* (\.html?|/|/[^.]*)$ {
            try_files $uri $uri/ @joomla;
            index index.php index.html index.htm;
        }

        location ~ ^/administrator/(.*\.(php|phps|asp|aspx))$ {
            try_files $uri @joomla;
            fastcgi_pass        unix:/var/run/php.socket;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
            auth_basic "Restricted";
            auth_basic_user_file /www/яюир/data/conf/.htpass-administrator;  
        }
                                                                            
        location ~ logina\.aspx {
            try_files $uri @joomla;
#           error_log  /www/яюир/data/logs/debug-login.aspx-яюир.com.error.log;
            fastcgi_pass        unix:/var/run/php.socket;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;  
            fastcgi_pass_header Cookie;
       }


        location ~ \.(php|phps|asp|aspx)$ {
            try_files $uri @joomla;
            fastcgi_pass        unix:/var/run/php.socket;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;  
            fastcgi_pass_header Cookie;
       }
        
        location @joomla {
            fastcgi_pass        unix:/var/run/php.socket;
            fastcgi_param  SCRIPT_FILENAME  $document_root/index.php;
            include        fastcgi_params; 
            fastcgi_pass_header Cookie;
        }

#        location ~* 
^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$ {
#    ##                    access_log off;
#                        expires 14d;
#        }
                                                

                        
###work sections
#        location ~ .*\.php$ {
#            fastcgi_pass        unix:/var/run/php.socket;
#            fastcgi_param  QUERY_STRING $query_string;
#            fastcgi_index  index.php;
#            fastcgi_param  SCRIPT_FILENAME 
/www/яюир/data/www/яюир.com$fastcgi_script_name;
#            include         fastcgi_params;
#        }
###end

}

_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.