@mind_of_ghost

Как настроить связку nginx и php-fpm на совместимость с модулем Opencart Custom Product Designer 3.0.0?

Проблема состоит в том, что при переходе по ссылке типа ".../tshirtecommerce/admin/index.php/user/login" в нас плюются ошибкой 404. Ссылка типа ".../tshirtecommerce/admin/index.php" работает нормально. При обследовании логов nginx выяснилось, что nginx не может найти папку ".../tshirtecommerce/admin/index.php/user/login", о чем и пишет. Внутренняя логика скрипта неизвестна, так-как папки ".../tshirtecommerce/admin/user/login в системе тоже нет, однако это не мешает этому модулю прекрасно работать в локальном дэнвере, который работает на апачи.
Надеюсь мне тут помогут, спасибо!!!
server {
listen 80;
#listen 443 ssl;
#ssl on;
#ssl_certificate /etc/nginx/server.crt;
#ssl_certificate_key /etc/nginx/server.key;
server_name www.site.com site.com;
access_log /var/log/nginx/site.access.log;
error_log /var/log/nginx/site.error.log;
charset utf8;
index index.php;
root /home/user/data/www/site.com/; 
limit_conn perip 20;
limit_conn perserver 150;
location / {
server_tokens off;
client_max_body_size 10m;
client_body_buffer_size 128k;


add_header X-Frame-Options DENY;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block;";

if ($request_method !~ ^(GET|HEAD|POST)$ ) {
return 444;
}

if ( $http_user_agent ~* (nmap|nikto|wikto|sf|sqlmap|bsqlbf|w3af|acunetix|havij|appscan) ) {
    return 403;
}
 
 
if ($http_user_agent ~* LWP::Simple|BBBike|wget|curl|msnbot|scrapbot) 
{ return 403; 
}
try_files $uri @opencart;
}
location @opencart { rewrite ^/(.+)$ /index.php?_route_=$1 last; }
location ~ /\.ht { deny all; }
location ~* (\.(tpl|ini))$ { deny all; }
if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?_route_=$1 last; }

location /admin {
index index.php;
}
location /tshirtecommerce/ {
index index.php;
allow all;
}


location ~* .(js|css|ico|xml|swf|flv|eot|ttf|woff|pdf|xls|htc)$ {
add_header Pragma "public";
add_header Cache-Control "public, must-revalidate, proxy-revalidate";
access_log off;
log_not_found off;
expires 90d;
}

location ~* .(jpg|jpeg|gif|css|png)$ {
access_log off;
expires 10d;
}

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/user/data/www/site.com$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 128k;
fastcgi_read_timeout 300;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param DOCUMENT_ROOT /home/user/data/www/site.com;
}
location /phpmyadmin/ {
root /usr/share/;
index index.php;
}

location ~ /\.ht {
deny all;
}
}
  • Вопрос задан
  • 782 просмотра
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы