worker_processes  1;

#[ debug | info | notice | warn | error | crit ]
error_log /nimp/component/logs/nginx/error.log error;

pid /nimp/component/logs/nginx/nginx.pid;

events {
  worker_connections  1024;
}

http {
  include      mime.types;
  
  default_type  application/octet-stream;

  client_body_temp_path /nimp/component/temp/nginx/client_body_temp;
  fastcgi_temp_path /nimp/component/temp/nginx/fastcgi_temp;
  proxy_temp_path  /nimp/component/temp/nginx/proxy_temp;
  uwsgi_temp_path  /nimp/component/temp/nginx/wsgi_temp;
  scgi_temp_path /nimp/component/temp/nginx/scgi_temp;

  # include /nimp/component/vhost/n-sites-enable/*;
  include /nimp/component/vhost/n-sites-enable/*.conf;
    
  client_header_timeout 3m;
  client_body_timeout 3m;
  send_timeout 3m;
  client_header_buffer_size 3k;
  large_client_header_buffers 6 4k;
  gzip on;
  gzip_min_length 1100;
  gzip_buffers 4 8k;
  gzip_types text/plain;
  output_buffers 1 32k;
  postpone_output 1460;
    
  sendfile       on;
  tcp_nopush     on;
  tcp_nodelay    on;
  keepalive_timeout 75 20;

  server {
    listen 80;
    server_name 127.0.0.1 localhost;
    server_name_in_redirect  off;
    
    access_log  /nimp/component/logs/nginx/access.log;
   
    location / {
      proxy_pass         http://127.0.0.1:8080/;# адрес и порт на котором работает apache
      include     /nimp/component/nginx/conf/proxy.conf;
    }
    
    location ~* \.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|xml|docx|xlsx)$ { # Обрабатываемые типы файлов
      root /nimp/htdocs; # Путь к кореневому каталогу вашего сайта
    }
    
    location = /stat {
      stub_status on;
      access_log  off;
      allow 127.0.0.1;
      deny all;
    }   
  }
  
  server {
    listen 80;
    server_name 127.0.0.1 localhost;
    
    access_log  /nimp/component/logs/nginx/access.log;

    location / {
    proxy_pass  http://127.0.0.1:8080;
    include     /nimp/component/nginx/conf/proxy.conf;
    }
    
    location ~* \.(jpg|jpeg|gif|png|ico|css|bmp|swf|js)$ {
      root /nimp/component/manager/phpmyadmin;
    }
    
    location ^~ /phpmyadmin/ {
        alias /nimp/component/manager/phpmyadmin/;
    } 
    
    location ~* (?:/phpmyadmin/).+\.(jpg|jpeg|gif|png|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|tar|wav|bmp|rtf|swf|ico|flv|txt|xml|docx|xlsx)$ {
        root /nimp/component/manager/phpmyadmin;
        index  index.html index.php;
        access_log off;
        expires 30d;
    }
    
  }
}