@EvgeniiR
https://github.com/EvgeniiR

Почему возникает ошибка 404 nginx?

Скачал исходники сайта по этой статье https://habrahabr.ru/post/150267/#Result (https://github.com/vitalyswipe/tinymvc/zipball/v0.1)
Попытался поставить у себя на локальном сервере с nginx и php-fpm
При попытке перейти на любую страницу кроме главное выходит ошибка 404 not found
В конфиге nginx ничего не менял. Конфиг для сайта:
server {
	listen 80;
	listen [::]:80;

	server_name visit.ru;

	root /home/evgeniy/mysites/visit.ru;

	index index.php;

	location / {
		# First attempt to serve request as file, then
		# as directory, then fall back to displaying a 404.
		try_files $uri $uri/ =404;
	}

	# pass PHP scripts to FastCGI server
	#
	location ~ \.php$ {
		include snippets/fastcgi-php.conf;
	
	#	# With php-fpm (or other unix sockets):
		fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
	#	# With php-cgi (or other tcp sockets):
	#	fastcgi_pass 127.0.0.1:9000;
	}

	# deny access to .htaccess files, if Apache's document root
	# concurs with nginx's one
	#
	#location ~ /\.ht {
	#	deny all;
	#}
}
  • Вопрос задан
  • 1772 просмотра
Решения вопроса 1
@Arik
try_files $uri $uri/ /index.php?$args;
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

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

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