R
R
Ruslan Absalyamov2018-08-21 09:59:51
Nginx
Ruslan Absalyamov, 2018-08-21 09:59:51

Why doesn't it give access?

I have the following config

server {
  listen 80;
  root /home/ruslan/Разработка/latina;
  index index.html index.htm index.php;
  
  server_name latina.site www.latina.site default_server;

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

    charset utf-8;

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

  location ~ \.php$ {
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    include snippets/fastcgi-php.conf;
    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
  }

  location ~ /\.(?!well-known).* {
        deny all;
    }


  location /admin/ {
    alias /home/ruslan/Разработка/latina/admin/public;
    fastcgi_index index.php;
  }

  location / {
    try_files $uri $uri/ /index.php?$query_string;
  }
}

When I access latina.site/admin , I get a 403 error.
Looking at the rights
drwxr-xr-x 13 ruslan ruslan 4096 Aug 18 13:29 admin
drwxr-xr-x 5 ruslan ruslan 4096 Aug 18 10:30 public
-rw-r--r-- 1 ruslan ruslan 1823 Jan 3 2018 index.php
THAT is not clear, it seems that it can read, but it will be displayed in the log
2018/08/21 09:49:52 [error] 10094#10094: *58 directory index of "/home/ruslan/Разработка/latina/admin/public" is forbidden, client: 127.0.0.1, server: latina.site, request: "GET /admin/ HTTP/1.1", host: "latina.site"

What should I do? New to Administration

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Radjah, 2018-08-21
@rusline18

What account is nginx running under? Does she have access to these directories?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question