Итак, к вашему сведению, ngnix вообще не анализирует htaccess, и Magento в значительной степени полагается на htaccess для обеспечения безопасности.
Прежде чем даже рассматривать вашу проблему, знайте, что если ваш сервер имеет что-либо кроме локального доступа, вы подвергаетесь риску, потому что, как вы можете видеть в файле app/etc/local.xml, доступном для всех, вы даете мир доступ к вашей базе данных.
Пожалуйста, полностью прочитайте этот документ: http://info.magento.com/rs/magentocommerce/images/MagentoECG-PoweringMagentowithNgnixandPHP-FPM.pdf, где вы можете найти базовую конфигурацию ngnix для Magento:
server {
listen 80 default;
server_name magento.lan www.magento.lan; # like ServerName in Apache
root /var/www/magento; # document root, path to directory with files
index index.html index.php;
autoindex off; # we don’t want users to see files in directories
location ~ (^/(app/\|includes/\|lib/\|/pkginfo/\|var/\|report/config.
xml)\|/\.svn/\|/\.git/\|/.hta.+) {
deny all; #ensure sensitive files are not accessible
}
location / {
try_files $uri $uri/ /index.php?$args; # make index.php handle requests for
/
access_log off; # do not log access to static files
expires max; # cache static files aggressively
}
location \~\* \.(jpeg\|jpg\|gif\|png\|css\|js\|ico\|swf)$ {
try_files $uri $uri/ @proxy; # look for static files in root directory and
ask backend if not successful
expires max;
access_log off;
}
location @proxy {
fastcgi_pass fpm_backend; # proxy everything from this location to backend
}
location \~\.php$ {
try_files $uri =404; # if reference to php executable is invalid return 404
expires off; # no need to cache php executable files
fastcgi_read_timeout 600;
fastcgi_pass fpm_backend; # proxy all requests for dynamic content to
# backend configured in upstream.conf
fastcgi_keep_conn on; # use persistent connects to backend
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root${fastcgi_script_name};
fastcgi_param MAGE_RUN_CODE default; # Store code is defined in
#administration > Configuration > Manage Stores
fastcgi_param MAGE_RUN_TYPE store;
}
}
Затем, когда и только когда вам будет отказано в доступе к файлу app/etc/local.xml, рассмотрите возможность добавления тега ngnix к вашему вопросу, тогда пользователь с большим знанием ngnix может помочь вам больше, чем я (поскольку это более работу системного администратора, чем работу «кодера», как я).
Все, что я могу сказать, это: похоже, если вы добавите fastcgi_param PHP_VALUE "session.auto_start=0";
в раздел
location \~\.php$ {
fastcgi_param PHP_VALUE "session.auto_start=0";
#... more come here but I'm shortening just for the specific problem
}
Это должно делать свое дело.
person
β.εηοιτ.βε
schedule
06.01.2015