serve robots.txt to search engines
[nginx_drupal.git] / conf / drupal_common
blobc04cb67e7e926a8f81f02a1cba707a0b4a784d37
1   charset utf-8;
3   # search for already compressed files
4   gzip_static on;
5   gzip on;
7   # some images have no mime type
8   default_type image/jpeg;
10   # Buffers definition. allows of up to 260k to be passed in memory.
11   client_body_buffer_size 1m;
12   proxy_buffering on;
13   proxy_buffer_size 4k;
14   proxy_buffers 8 32k;
16   # 404 generated from php can be rather slow. Uncomment with care
17   #error_page  404              /index.php;
19   # disallow access to version control directory, but return 404, not to disclose information
20   location /.git {
21     return 404;
22   }
23   
24   # robots.txt is important for search engines
25   location /robots.txt {
26     access_log off;
27   }
29   # This is mostly based on Drupal's stock .htaccess
30   location ~* ^.+(\.(txt|engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)|code-style\.pl|/Entries.*|/Repository|/Root|/Tag|/Template)$ {
31     return 404;
32   }
34   # serve imagecache files directly or redirect to drupal if they do not exist
35   location ^~ /files/imagecache {
36     access_log off;
37     expires 30d;
38     try_files $uri @drupal;
39   }
41   # serve static files directly
42   location ~* ^.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|swf)$ {
43     access_log        off;
44     expires           30d;
45   }
46   
47   # This rewrites pages to be sent to PHP processing
48   location @drupal {
49     rewrite ^/(.*)$ /index.php?q=$1 last;
50   }