nginx:отладка

Debug locations

   set $no_cache "0";
   set $debug "";

   location = /favicon.ico {
        log_not_found off;
        access_log off;
   }

   location = / {
        # Temporary redirect
        rewrite ^ all-offers permanent;
   }

   # No Cache
   location ~* (/admin|/cart|/account|/checkout|/profile|/cron\.php|/update\.php|\.js|\.css|ajax) {
        set $no_cache "1";
        log_not_found off;
        access_log off;
        set $debug "$debug, No cache";
        try_files $uri $uri/ @rewrite; #check for existence of php file
   }

   # Drupal 7 ImageCache.
   location ~ ^/sites/.*/files/styles/ {
        access_log off;
        expires 30d;
        set $debug "$debug, Use ImageCache";
        try_files $uri $uri/ @rewrite;
   }

   location / {
        set $debug "$debug, Use root";

        # Если прямое обращение к php переадресуем его на index.php
        try_files $uri $uri/ @rewrite; #check for existence of php file
   }


   location @rewrite {
        # Some modules enforce no slash (/) at the end of the URL
        # Else this rewrite block wouldn't be needed (GlobalRedirect)
        rewrite ^(.*)$ /index.php?q=$1;
        set $debug "$debug, Use rewrite";
   }

   location ~ \.php$ {

        include cache;
        set $debug "$debug, No cache = $no_cache";

        add_header Server-Cfg "$debug, Use fastcgi";
        include fastcgi_params;
   }
  • nginx/отладка.txt
  • Последнее изменение: 2012/07/18 06:28
  • 127.0.0.1