Re: Свои настройки php для разных location
VovansystemS
vovansystems на gmail.com
Чт Июл 23 19:18:41 UTC 2015
конфиг:
server {
listen 80;
server_name test.com;
error_log /home/user/logs/test.com.error.log error;
access_log /home/user/logs/test.com.access.log wtimes buffer=16k flush=1m;
root /www/user/domains/test.com/public_html/;
set $sock unix:/home/user/domains/test.com/socket.sock;
index index.html index.php;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location = /z.php {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param DOCUMENT_ROOT /public_html;
fastcgi_param SCRIPT_FILENAME /public_html$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE memory_limit=64M;
fastcgi_param PHP_ADMIN_VALUE memory_limit=512M;
try_files $fastcgi_script_name =404;
fastcgi_pass $sock;
}
location ~* \.php$ {
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param DOCUMENT_ROOT /public_html;
fastcgi_param SCRIPT_FILENAME /public_html$fastcgi_script_name;
fastcgi_param PHP_ADMIN_VALUE memory_limit=64M;
try_files $fastcgi_script_name =404;
fastcgi_pass $sock;
}
}
проверяем через print_r(ini_get_all(null, false));
делаем запрос к http://test.com - показывает [memory_limit] => 512M
делаем запрос к http://test.com/z.php - показывает [memory_limit] => 64M
Подробная информация о списке рассылки nginx-ru