ПРОЕКТЫ 


  АРХИВ 


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: научите пересобирать NGINX с нужными модулями



IP и имена доменов изменены

server {
                listen 11.11.11.11:80;
                server_name mysite.ru www.mysite.ru;
                location ~* 
^/(awstats/|webmail/|phpmyadmin/|server-status/|backups/)
{
                        proxy_pass http://11.11.11.11:8080;
                        proxy_redirect http://mysite.ru:8080/ /;
                        proxy_set_header Host $host;
                        proxy_set_header X-Forwarded-For 
$proxy_add_x_forwarded_for;
                        proxy_set_header X-Real-IP $remote_addr;
                }
                location / {
                        proxy_pass http://11.11.11.11:8080;
                        proxy_redirect http://mysite.ru:8080/ /;
                        proxy_set_header Host $host;
                        proxy_set_header X-Forwarded-For 
$proxy_add_x_forwarded_for;
                        proxy_set_header X-Real-IP $remote_addr;
                }
                location ~*
^.+\.(jpg|jpeg|gif|png|tiff|svg|eps|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar|wav|tar|exe|wmv|ico|tgz|mid|midi|bmp|flv|swf)$
{
                        access_log /var/www/logs/mysite.ru.access_nginx.log;
                        error_page 404 = @fallback;
                        set $droot "/var/www/mysite.ru";
                        if ( $host = "mysite.ru" ) {
                                break;
                        }
                        if ( $host = "www.mysite.ru" ) {
                                break;
                        }
                        if ( $host ~* ^(.*).mysite.ru$ ) {
                                set $proot /var/www/mysite.ru/$1;
                                break;
                        }

                        root $droot;
                }
                location /block {
                        auth_basic "Restricted";
                        auth_basic_user_file /var/www/mysite.ru/block/.htpasswd;
               }
                location @fallback {
                        proxy_pass http://11.11.11.11:8080;
                        proxy_set_header Host $host;
                        proxy_set_header X-Forwarded-For 
$proxy_add_x_forwarded_for;
                        proxy_set_header X-Real-IP $remote_addr;
                }
}

Posted at Nginx Forum: 
http://forum.nginx.org/read.php?21,224781,224831#msg-224831

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


 




Copyright © Lexa Software, 1996-2009.