Re: get-

Мисбах-Соловьëв Вадим mva mva.name
24 06:32:12 UTC 2011


-,   ,           fastcgi   $document_root
-,     .   ,   ,     ,    .
-,       ,   ;) , ,      -.

On  24  2011 11:58:03 KRAT, valet <nginx-forum  nginx.us> wrote:

>    Debian,  
>   (bind9, nginx+php-fpm).
>     .
>   nginx    
>   get-
>   .
>       
> site1.ru.access.log Googlebot/2.1   
>    
> ...
> ..."GET /stranica-site2-1.html HTTP/1.1"...
> ...
> ..."GET /stranica-site2-n.html HTTP/1.1"...
> ... 
>     -  site2.ru 
>     site1.ru 
> ,  ,   
>    , 
>    -  - 
> .     ,
>     fast-cgi- 
> nginx    -     
>   .
>       
>     .
> ,     
>  ,   10
>    ( 
>  ,  
>    ).
> 
>  :
>  nginx.conf 
> user www-data;
> worker_processes 8;
> 
> #    
> gettimeofday(),    
> 
> timer_resolution 100ms;
> 
> #    
>   RLIMIT_NOFILE 
>  .
> worker_rlimit_nofile 8192;
> 
> #    
>   -20  20 (
>    
> ).
> worker_priority -5;
> 
> events {
>     #worker_connections  1024;
>     worker_connections  16384;
>     use epoll;
>     multi_accept off;
> }
> 
> 
> pid /var/run/nginx.pid;
> 
> 
> http {
> 
>  ##
>  # Basic Settings
>  ##
> 
> include blockips.conf;
> 
>  sendfile on;
>  tcp_nopush on;
>  tcp_nodelay on;
>  #keepalive_timeout 65;
>  keepalive_timeout 5;
>  types_hash_max_size 2048;
>  # server_tokens off;
> 
>  # server_names_hash_bucket_size 64;
>  # server_name_in_redirect off;
> 
>  include /etc/nginx/mime.types;
>  default_type application/octet-stream;
> 
>  ##
>  # Logging Settings
>  ##
> 
>  access_log /var/log/nginx/access.log;
>  error_log /var/log/nginx/error.log;
> 
>  ##
>  # Gzip Settings
>  ##
> 
>  gzip on;
>  gzip_disable "msie6";
> 
>  # gzip_vary on;
>  # gzip_proxied any;
>  # gzip_comp_level 6;
>  # gzip_buffers 16 8k;
>  # gzip_http_version 1.1;
>  # gzip_types text/plain text/css application/json
> application/x-javascript text/xml application/xml application/xml+rss
> text/javascript;
> 
> #    gzip_min_length  1100;
>     gzip_buffers     64 8k;
>     gzip_comp_level 8;
>     gzip_types text/plain application/xml application/x-javascript
> text/css;
>     gzip_proxied any;
> 
> #
> #fastcgi_cache_path /tmp/nginx/ levels=1:2 keys_zone=fastcgi_cache:16m
> max_size=256m inactive=1d;
> 
>  ##
>  # Virtual Host Configs
>  ##
> 
> 
> # default virtual host
> server {
> listen 80 default;
> server_name localhost;
> deny all;
> }
> 
> 
>  include /etc/nginx/conf.d/*.conf;
>  include /etc/nginx/sites-enabled/*;
> }
> 
>  :
> server {
>     listen  80;
>     server_name site.ru;
>     access_log  /var/log/nginx/site.ru.access.log;
>     error_log  /var/log/nginx/site.ru.error.log;
> 
>     gzip_static on;
> 
> if ($http_user_agent ~ ZmEu) {
> return 503;
> }
> 
> ##    
>   1 
> client_max_body_size 1m;
> 
> root   /var/www/site.ru;
> 
> ## Default location
>     location / {
>         index index.php index.html index.htm;
>         include /var/www/site.ru/.htaccess;
> }
> 
> location ^~ /uploads/ {
>  access_log off;
>  expires max;
> }
> 
> location ^~ /templates/ {
> }
> 
> location /robots.txt {
> alias /var/www/site.ru/robots_$host.txt;
> }
> 
> location /sitemap.xml {
> alias /var/www/site.ru/uploads/sitemap_$host.xml;
> }
> 
> ## Images and static content is treated different
>     location ~* ^.+.(jpg|jpeg|gif|png|js|ico)$ {
>       access_log        off;
>       expires           max;
>     }
> 
> location /index.php {
>  return 301 /;
> }
> 
> ## Parse all .php file in the /var/www/site.ru directory
>     location ~ \.php$ {
>  try_files $uri =404;
>         fastcgi_split_path_info ^(.+\.php)(.*)$;
>         #fastcgi_pass   127.0.0.1:9000;
>         fastcgi_pass   unix:/tmp/php-fpm.sock;
>         fastcgi_index  index.php;
>         fastcgi_param  SCRIPT_FILENAME 
> /var/www/site.ru$fastcgi_script_name;
>         include fastcgi_params;
>         fastcgi_param  QUERY_STRING     $query_string;
>         fastcgi_param  REQUEST_METHOD   $request_method;
>         fastcgi_param  CONTENT_TYPE     $content_type;
>         fastcgi_param  CONTENT_LENGTH   $content_length;
>         fastcgi_intercept_errors        on;
>         fastcgi_ignore_client_abort     off;
>         fastcgi_connect_timeout 60;
>         fastcgi_send_timeout 180;
>         fastcgi_read_timeout 180;
>         fastcgi_buffer_size 128k;
>         fastcgi_buffers 4 256k;
>         fastcgi_busy_buffers_size 256k;
>         fastcgi_temp_file_write_size 256k;
> # FastCGI-
> #fastcgi_pass_header "Set-Cookie"; #  
>  cookie  
> ,  cookie   phpsessid
>     $cookie_phpsessid
> #
> #            #fastcgi_ignore_headers Cache-Control Expires Set-Cookie; #
>  ,  
> ,  
> FastCGI-
> #            fastcgi_cache_key
> "$server_addr:$server_port$request_uri|$cookie_phpsessid"; #
>   ;  
>    
>  $cookie_phpsessid
> #            fastcgi_cache fastcgi_cache; #   ,
>    
> - fastcgi_cache
> #            fastcgi_temp_path  /tmp/nginx/temp 1 2; #
>     
> 
> #            fastcgi_cache_use_stale updating error timeout
> invalid_header http_500; #   
>  (   )  
> 
> #fastcgi_cache_valid  200 302 10m;
> #fastcgi_cache_valid  301 1h;
> #fastcgi_cache_valid  any 1m;
>     }
> 
> ## Disable viewing .htaccess & .htpassword
>     location ~ /\.ht {
>         deny  all;
>     }
> 
> }
> 
> server {
>     listen       80;
>     server_name www.site.ru;
>     rewrite   ^  http://site.ru$request_uri?;
> }
> 
> ,  ?
> 
> Posted at Nginx Forum:
> http://forum.nginx.org/read.php?21,218912,218912#msg-218912
> 
> _______________________________________________
> nginx-ru mailing list
> nginx-ru  nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru

-- 
 ,
mva



nginx-ru