The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]



Индекс форумов
Составление сообщения

Исходное сообщение
"Проблемы с добавление виртуал-хоста к nginx"
Отправлено Kreept, 23-Янв-08 12:40 
>>Здравствуйте, возникла проблема при добавлении второго виртуал-хоста в nginx, на втором ИП
>>адресе.  nginx не может стартовать а в логах  
>>следующая ошибка:
>>bind() to 192.168.0.2:80 failed (99: Cannot assign requested address)
>>Буду благодарен за любую помощь.
>>PS. ОС: Fedora 7
>
>Конфиг покажите.
>Надеюсь там одна секция http?

Да одна.

user apache apache;
worker_processes  1;
worker_rlimit_nofile 40000;

error_log  /var/log/nginx/error.log;

pid        /var/run/nginx/nginx.pid;

events {
    worker_connections  25000;
}

http {
    include       /usr/local/nginx/etc/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] $status '
                      '"$request" $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';
#    log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent"';


    access_log  /var/log/nginx/access.log  main;

    limit_zone   one  $binary_remote_addr  10m;
    limit_conn   one  7;
    limit_rate         512K;

    client_header_timeout       60;
    client_body_timeout         60;
    send_timeout                120;
    proxy_read_timeout          60;
    proxy_connect_timeout       60;
    proxy_send_timeout          180;

    msie_padding                on;

    proxy_buffer_size           32K;
    proxy_buffers               64 512K;
    proxy_busy_buffers_size     1024K;
    proxy_temp_file_write_size  1024K;

    gzip on;
    gzip_min_length  10240;
    gzip_buffers     32 64k;
    gzip_types       text/html application/x-javascript text/css text/xml text/plain;

    client_header_buffer_size   4K;
    client_max_body_size        100000000;
    large_client_header_buffers 16 8K;

    sendfile            on;
    tcp_nopush          on;
    tcp_nodelay         on;

    output_buffers   32 256k;
    postpone_output  1460;

    lingering_time     30;
    lingering_timeout  6;
    reset_timedout_connection  on;

    keepalive_timeout  20;

    server_names_hash_bucket_size 64;
server {
        listen       192.168.0.1:80 default rcvbuf=8192 sndbuf=16384 backlog=32000;
        server_name server.domain.com;
        access_log  /var/log/httpd/access_log  main;
        error_log   /var/log/httpd/domains/access_log info;
        error_log   /var/log/httpd/domains/error_log notice;
        location / {
                    proxy_pass         http://192.168.0.1:8080/;
                    proxy_redirect     off;

                    proxy_set_header   Host             $host;
                    proxy_set_header   X-Real-IP        $remote_addr;
                    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
                }

        #Static files location
        location ~* ^.+\.(jpg|jpeg|gif|mp3|png|avi|vob|mpg|mpeg|mp4|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js)$ {
            root /var/www/html;
        }
    }
server {
        listen       192.168.0.2:80;
        server_name  domain2.com www.domain2.com;
        access_log /var/log/httpd/domains/domain2.com.log  main;
        error_log  /var/log/httpd/domains/domain2.com.error.log info;
        error_log  /var/log/httpd/domains/domain2.com.error.log notice;
        location / {
                        proxy_pass         http://192.168.0.2:8080/;
                        proxy_redirect     off;

                        proxy_set_header   Host             $host;
                        proxy_set_header   X-Real-IP        $remote_addr;
                        proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;
                    }

        #Static files location
location ~* ^.+\.(jpg|jpeg|gif|mp3|html|png|avi|vob|mpg|mpeg|mp4|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js)$ {
            root /home/domain2.com/public_html;
        }
}
}

 

Ваше сообщение
Имя*:
EMail:
Для отправки новых сообщений в текущей нити на email укажите знак ! перед адресом, например, !user@host.ru (!! - не показывать email).
Более тонкая настройка отправки ответов производится в профиле зарегистрированного участника форума.
Заголовок*:
Сообщение*:
 
При общении не допускается: неуважительное отношение к собеседнику, хамство, унизительное обращение, ненормативная лексика, переход на личности, агрессивное поведение, обесценивание собеседника, провоцирование флейма голословными и заведомо ложными заявлениями. Не отвечайте на сообщения, явно нарушающие правила - удаляются не только сами нарушения, но и все ответы на них. Лог модерирования.

На сайте действует частичное премодерирование - после публикации некоторые сообщения от анонимов могут автоматически скрываться ботом. После проверки модератором ошибочно скрытые сообщения раскрываются. Для ускорения раскрытия можно воспользоваться ссылкой "Сообщить модератору", указав в качестве причины обращения "скрыто по ошибке".



Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру