@Kerm

Почему заголовок 404 file not found когда файл открыт в браузере?

635aaeff7c771660608650.jpeg

Честно сталкиваюсь с таким впервые, на сайте не отображаются стили и скрипты, пишет 404, но по прямой ссылке если перейти то файлы открываются, но у них тоже заголовок 404, почему?

server {
    listen 80;
    listen [::]:80;
    server_name site.com;
    root /home/heqs/build;

    add_header X-Frame-Options "SAMEORIGIN";
    add_header X-Content-Type-Options "nosniff";

    index index.html;

    charset utf-8;

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

    location /api {
        index index.php;
        root /home/heqs/build;
        try_files $uri $uri/ /index.php?$query_string;
    }

    location /docs/asset {
        root /home/heqs/public/docs;
    }

    #location / {
        #proxy_pass http://localhost:3000;
        #proxy_set_header Host $host;
    #}

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

    error_page 404 /index.php;

    location ~ \.php$ {
        index index.php;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
        include fastcgi_params;
    }

    location ~ /\.(?!well-known).* {
        deny all;
    }
}
  • Вопрос задан
  • 130 просмотров
Пригласить эксперта
Ваш ответ на вопрос

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

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