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