Почему не корректно работает виртуальный хост?

Здравствуйте

ubuntu 16.04 + php 7 + nginx

pasha4ur.local - 404 при try_files $uri =404; или File not found при try_files $uri $uri/ =404;.
pasha4ur.local/index.html - access denied (Other - read only)
pasha4ur.local/index.php - ok

Ставил на папку и файлы 777 - 0 эффекта.

/etc/nginx/sites-enabled/pasha4ur.local

#this first server module is just a rewrite directive – it is not required, and you
#can make the rewrite go the other way, to force NOT using www
server {
listen 80; #sets the HTTP port from which the website is served
server_name www.pasha4ur.local; #names the server using the www prefix
#if a server request is made without www, this next line will rewrite it
rewrite ^/(.*) http://pasha4ur.local$request_uri? permanent; #301 redirect
}
#this second server module tells Nginx where to find the files when requested
server {
listen 80; #sets the HTTP port from which the website is served
server_name pasha4ur.local; #names the server being configured
root /home/pasha4ur/public_html/pasha4ur.local; #top directory for the site
index index.php index.html index.htm index.nginx-debian.html;
client_max_body_size 1G;
fastcgi_buffers 64 4K;
location / { #sets the location of the files being served
try_files $uri $uri/ =404;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}


переписывал rewrite и try_files многими способами по статьям из Гугла, перезапускал сервер - толку 0.

П.С. Только, плиз, ответьте понятным языком :)
  • Вопрос задан
  • 148 просмотров
Пригласить эксперта
Ответы на вопрос 1
@nikolayvaganov
Зачем внутри локейшена try_files ?
Ответ написан
Ваш ответ на вопрос

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

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