Re: Перенаправление на server name

Igor Sysoev igor на sysoev.ru
Ср Сен 1 20:38:20 MSD 2010


On Wed, Sep 01, 2010 at 11:58:34AM -0400, Hello1 wrote:

> [code]
>     server {
>         listen       80;
>         server_name  example.com;
> 
>         root   /usr/local/www;
>         index  index.php index.html index.htm;
> 
>         error_page   500 502 503 504  /50x.html;
>         location = /50x.html {
>             root   /usr/local/www/nginx-dist;
>         }
> 
>         location ~ \.php$ {
>            fastcgi_pass   unix:/var/run/fastcgi.socket;
>            fastcgi_index  index.php;
>            fastcgi_param  SCRIPT_FILENAME 
> $document_root$fastcgi_script_name;
>            include        fastcgi_params;
>         }
> 
>     }
> [/code]
> Часть nginx.conf
> При попытке открыть файл в корневой
> директории проблем нет (прим.
> http://62.109.1.207/index.html)
> Но если попробовать открыть папку
> (прим. http://62.109.1.207/nginx-dist), то идет
> перенаправление на хост, указанный в
> server_name

http://sysoev.ru/nginx/docs/http/ngx_http_core_module.html#server_name_in_redirect


-- 
Игорь Сысоев
http://sysoev.ru



Подробная информация о списке рассылки nginx-ru