ðòïåëôù 


  áòèé÷ 


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



umask ÐÉÛÅÔ:
ÎÕÖÎÙ ËÏÎÆÉÇ nginx'Á É ×Ù×ÏÄ ËÏÍÁÎÄÙ `ip a'.



29.01.08, 12:23, "Yaroslav" <yarik@xxxxxxxxxxxxxxxxx>:



  
úÄÒÁ×ÓÔ×ÕÊÔÅ, ×ÏÚÎÉËÌÁ ÐÒÏÂÌÅÍÁ ÐÒÉ ÄÏÂÁ×ÌÅÎÉÉ ×ÔÏÒÏÇÏ 
    

  
×ÉÒÔÕÁÌØÎÏÇÏ-ÈÏÓÔÁ × nginx, ÎÁ ×ÔÏÒÏÍ éð ÁÄÒÅÓÅ.  nginx ÎÅ ÍÏÖÅÔ 
    

  
ÓÔÁÒÔÏ×ÁÔØ. ÷ ÌÏÇÁÈ ÓÌÅÄÕÀÝÁÑ ÏÛÉÂËÁ:
    

  
bind() to 192.168.0.2:80 failed (99: Cannot assign requested address)
    

  
âÕÄÕ ÂÌÁÇÏÄÁÒÅÎ ÚÁ ÌÀÂÕÀ ÐÏÍÏÝØ.
    

  
PS.
    

  
ðÒÏÂÏ×ÁÌ echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle ÎÅ ÐÏÍÏÇÌÏ
    

  
ïó: Fedora 7
    


  
ëÏÎÆÉÇ nginx'Á:

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;
šššššššš}
}
}
÷Ù×ÏÄ ËÏÍÁÎÄÙ ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue
ššš link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
ššš inet 127.0.0.1/8 scope host lo
ššš inet6 ::1/128 scope host
šššššš valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000
ššš link/ether 00:e0:81:5b:17:7e brd ff:ff:ff:ff:ff:ff
ššš inet 192.168.0.1/23 brd 195.189.227.255 scope global eth0
ššš inet 192.168.0.2/23 brd 195.189.227.255 scope global secondary eth0:1
ššš inet6 fe80::2e0:81ff:fe5b:177e/64 scope link
šššššš valid_lft forever preferred_lft forever
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
ššš link/ether 00:e0:81:5b:17:7f brd ff:ff:ff:ff:ff:ff
ššš inet 10.11.11.20/24 brd 10.11.11.255 scope global eth1


 




Copyright © Lexa Software, 1996-2009.