Re: nginx 1.0.4 É virtual hosts
Slava Kokorin
slava.kokorin ÎÁ gmail.com
÷Ô á×Ç 9 08:41:29 UTC 2011
9 Á×ÇÕÓÔÁ 2011šÇ. 12:32 ÐÏÌØÚÏ×ÁÔÅÌØ t0rik <nginx-forum ÎÁ nginx.us> ÎÁÐÉÓÁÌ:
> ÅÓÔØ ×ÏÔ ÔÁËÏÊ ËÏÎÆÉÇ,× ÁÐÁÞÅ ×ÉÒÔÕÁÌËÉ
> ÎÁÓÔÒÏÅÎÙ É ÒÁÂÏÔÁÀÔ.
>
> user šwww;
> worker_processes š2;
>
> events {
> š šworker_connections š512;
> š š}
>
> š šhttp {
> š šinclude š š š /usr/local/etc/nginx/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"';
>
> #access_log on;
> #error_log on;
> š šaccess_log š/var/log/nginix/access.log;
> š šerror_log š/var/log/nginix/nginx-error.log notice;
>
> š šsendfile š š š on;
> š štcp_nopush š š on;
> š štcp_nodelay š šon;
>
> š server {
> š listen š š š 80;
> šserver_name šdomain1 www.domain1;
>
> š# Main location
> šlocation / {
> šproxy_pass š http://127.0.0.1:81;
> šproxy_redirect default;
> šproxy_set_header š Host $host;
> šproxy_set_header š X-Real-IP š š š š$remote_addr;
> šproxy_set_header š X-Forwarded-For š$proxy_add_x_forwarded_for;
> šclient_max_body_size š š š 10m;
> šclient_body_buffer_size š š128k;
> šproxy_connect_timeout š š š90;
> šproxy_send_timeout š š š š 90;
> šproxy_read_timeout š š š š 90;
> šproxy_buffer_size š š š š š32k;
> šproxy_buffers š š š š š š š4 32k;
> šproxy_busy_buffers_size š š64k;
> šproxy_temp_file_write_size 64k;
> šproxy_max_temp_file_size 0;
>
> š}
> š# Static files location
> šlocation ~*
> ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js)$
> {
> š š š šaccess_log š off;
> š š š šexpires š š š30d;
>
> šroot š /disk2/www/domain1;
> š}
> š}
>
> šserver {
> šlisten 80;
> šserver_name domain2 www.domain2;
> šlocation / {
> šproxy_pass š š š š http://127.0.0.1:81/;
> šproxy_redirect
> šproxy_set_header š Host;
÷Ï ×ÔÏÒÏÍ ÂÌÏËÅ server Õ ×ÁÓ
proxy_set_header Host;
÷ÅÒÏÑÔÎÏ, ÏÔÓÀÄÁ ÔÁËÏÅ ÐÏ×ÅÄÅÎÉÅ backend-Á.
÷ ×ÁÛÅÍ ÓÌÕÞÁÅ ÄÏÌÖÎÏ ÂÙÔØ ÔÁË ÖÅ, ËÁË É × ÐÅÒ×ÏÍ ÂÌÏËÅ server {} :
proxy_set_header Host $host;
> šproxy_set_header š X-Real-IP š š š š$remote_addr;
> šproxy_set_header š X-Forwarded-For š$proxy_add_x_forwarded_for;
> šclient_max_body_size š š š 10m;
> šclient_body_buffer_size š š128k;
> šproxy_connect_timeout š š š90;
> šproxy_send_timeout š š š š 90;
> šproxy_read_timeout š š š š 90;
> šproxy_buffer_size š š š š š32k;
> šproxy_buffers š š š š š š š4 32k;
> šproxy_busy_buffers_size š š64k;
> šproxy_temp_file_write_size 64k;
> š}
> š# Static files location
> šlocation ~*
> ^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|wav|bmp|rtf|js)$
> {
> š š š šaccess_log š off;
> š š š šexpires š š š30d;
> šroot š /disk2/www/domain2;
>
> š}
> š}
>
> š}
>
>
> ÎÏ ÐÒÉ ÚÁÈÏÄÅ ÎÁ domain2 ÇÒÕÚÉÔÓÑ domain1.
> ÐÏÄÓËÁÖÉÔÅ ÐÏÖÁÌÕÊÓÔÁ × ÞÅÍ ÍÏÖÅÔ ÂÙÔØ
> ÐÒÏÂÌÅÍÁ?
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?21,213561,213561#msg-213561
>
> _______________________________________________
> nginx-ru mailing list
> nginx-ru ÎÁ nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru
>
--
Regards,
Slava
ðÏÄÒÏÂÎÁÑ ÉÎÆÏÒÍÁÃÉÑ Ï ÓÐÉÓËÅ ÒÁÓÓÙÌËÉ nginx-ru