Добрый день! Почему та nginx делает бесконечный редирект на /zabbix->/zabbix/->/zabbix итд, можете помочь? Где ошибка?
Ссылкаserver {
server_name site.com;
merge_slashes off;
rewrite (.*)//+(.*) $1/$2 permanent;
rewrite ^/(.*)/$ /$1 permanent;
error_log /var/log/nginx/site.com/error.log;
access_log /var/log/nginx/site.com/access.log;
root /var/www/site.com/public;
index index.php index.html index.htm;
client_max_body_size 100m;
if ($request_uri ~* "^(.*/)index\.php$") {
return 301 $1;
}
location ~ [A-Z]*\.(css|scss|js|html|svg|eot|ttf|woff) {
}
location / {
if ( $uri != $uri_lowercase ) {
rewrite . $scheme://$host$uri_lowercase;
}
try_files $uri $uri/ /index.php?$query_string;
}
location /zabbix {
root /usr/share/;
index index.php index.html index.htm;
location ~ ^/zabbix/(.+\.php)$ {
try_files $uri =404;
root /usr/share/;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include /etc/nginx/fastcgi_params;
}
location ~* ^/zabbix/(.+\.(jpg|jpeg|gif|css|png|js|ico|html|xml|txt))$ {
root /usr/share/;
}
}
location ~ ^/image/(.*)$ {
try_files $uri /image.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index image.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi.conf;
}
location ~ /\.(ht|git) {
deny all;
}
}