Re: настройка nginx для прокс??рования н??скольких ??айтов

valem nginx-forum at nginx.us
Tue Oct 13 17:45:24 MSD 2009


Igor Sysoev Пишет:

> Лучше
> 
>    map $host $tomact {
>        sub1.domain.com   /uri1;
>        sub2.domain.com   /uri2;
>        ...
>    }
> 
>    server {
> 
>        location / {
>            proxy_pass  http://backend$tomcat;
>        }

Попробовал настроить так, как вы сказали.

    map $host $magnolia {
                domain.ru           /;
                sub.domain.ru     /path/to/index.html;
    }


    server {
        listen       8080;
        server_name  _;


        location / {
                proxy_pass http://localhost$magnolia;
        }
        ...
        }

При прямом обращении, т.е. http://domain.ru//path/to/index.html - работает.
Но при попытке обращения к nginx (0.6.39 из дистрибутива CentOS 5), т.е. http://sub.domain.ru/ 
выбрасывает на страницу 5xx.html. Где я ошибся в настройке?

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






More information about the nginx-ru mailing list