Ранее был lighttpd на centos 7.X, всё работало корректно.Сейчас имею nginx 1.10 с ubuntu 16.04.
Zabbix работает корректно, переходит по всем каталогам. У других веб-ресурсов не работает переход по каталогам - вместо этого возвращает значение 404, то есть, главная страница отображается и те, которые не требуют реврайт, все последующие с значением 404.
Конфиг Nginx:
server {
root /var/www/html;index index.php index.html index.htm;
server_name my_site.com;
location / {
try_files $uri $uri/ =404;
}location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
}Логи:
2017/03/01 02:19:53 [error] 25546#25546: *1 "/home/www/test/test2/index.php" is not found (2: No such file or directory), clie$2017/03/01 02:19:55 [error] 25546#25546: *2 "/home/www/test/test3/index.php" is not found (2: No such file or directory), client: IP_ADDRESS, server: zom$
Переезжали так:
tar -cvvf test.tar ./
vsftpd -> filezilla -> windows -> http
wget
tar -xvvf test.tarmysqldump -u root -p dumpdb > dumpfile.sql
mysql -u root -p
CREATE DATABASE `db_name` CHARACTER SET utf8 COLLATE utf8_general_ci;
exit
mysql -u root -p db_name < dumpfile.sql
Пробовали скидывать на php:
location / {
try_files $uri $uri/ @backend;
}location @backend {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}Конфиг fastcgi-php.conf:
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;fastcgi_index index.php;
include fastcgi.conf;
Почти попали.№1
location / {
try_files $uri $uri/ =404;
}location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
URI для .php должен совпадать с путём от root. Это самый простой способ.№2
location / {
try_files $uri $uri/ @backend;
}location @backend {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
См. №1 + @backend не понял, чего от него хотят - посмотри его логи + логи nginx с его точки зрения.
Упс, не могу пасс восстановить.Спасибо.
>[оверквотинг удален]
> location / {
> try_files $uri $uri/ =404;
> }
> location ~ \.php$ {
> include snippets/fastcgi-php.conf;
> fastcgi_pass unix:/run/php/php7.0-fpm.sock;
> }
>
URI для .php должен совпадать с путём от root.
Перепробовал разные вариации, но не помогло... Можно как-то поконкретней? Желательно сразу "фиксом".