>>Здравствуйте, возникла проблема при добавлении второго виртуал-хоста в 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;
}
}
}