Инструменты пользователя

Инструменты сайта


nginx

server {

   root /vhosts/example.com/public_html/web/;
   
   location ~/api/.*\.php {
      error_page 406 = @fastcgi-api;
      return 406;
   }
   
   location ~/api {
      add_header X-DEBUG "DT-LOC" always;
      root /vhosts/example.com/public_html/api;
   }

   location ~ \.php$ {
      error_page 406 = @fastcgi;
      return 406;
   }

   location @fastcgi {
      add_header X-DEBUG "FAST-CGI" always;
   
      fastcgi_pass unix:/run/php/php5.6-fpm.sock;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      ...
   }
   
   location @fastcgi-api {
      root /vhosts/example.com/public_html/api/;

      add_header X-DEBUG "FAST-CGI-API" always;
   
      fastcgi_pass unix:/run/php/php5.6-fpm.sock;
      fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
      ...
   }   
}

nginx.txt · Последние изменения: 2016/06/09 17:25 — root